home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / pascal / wndw70.zip / WNDW70A.DOC < prev    next >
Text File  |  1993-06-10  |  126KB  |  3,091 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                            MULTI-LEVEL VIRTUAL WINDOWS
  20.                                   USER'S GUIDE
  21.  
  22.                                   Version 7.0a
  23.                                   June 10, 1993
  24.  
  25.  
  26.                   Copyright (C) 1993 Eagle Performance Software
  27.                               All Rights Reserved.
  28.  
  29.  
  30.  
  31.                                _______                     
  32.                           ____|__     |               (tm) 
  33.                        --|       |    |------------------- 
  34.                          |   ____|__  |  Association of    
  35.                          |  |       |_|  Shareware         
  36.                          |__|   o   |    Professionals     
  37.                        -----|   |   |--------------------- 
  38.                             |___|___|    MEMBER            
  39.  
  40.  
  41.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  42.  
  43.  
  44.  
  45.                        T A B L E   O F   C O N T E N T S
  46.  
  47.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 4
  48.              Features .  . . . . . . . . . . . . . . . . . . . . . 4
  49.              Using the Manuals . . . . . . . . . . . . . . . . . . 4
  50.              Licensing . . . . . . . . . . . . . . . . . . . . . . 5
  51.              Customer Service  . . . . . . . . . . . . . . . . . . 5
  52.              ASP . . . . . . . . . . . . . . . . . . . . . . . . . 6
  53.  
  54.         2. GETTING STARTED . . . . . . . . . . . . . . . . . . . . 7
  55.              Distribution Files  . . . . . . . . . . . . . . . . . 7
  56.              Demonstration . . . . . . . . . . . . . . . . . . . . 7
  57.  
  58.         3. PROGRAMMING WINDOWS . . . . . . . . . . . . . . . . . . 8
  59.              Basic Programming . . . . . . . . . . . . . . . . . . 8
  60.              Window Definitions  . . . . . . . . . . . . . . . . . 9
  61.              Basic Routines  . . . . . . . . . . . . . . . . . . . 10
  62.              MakeWindow Parameters . . . . . . . . . . . . . . . . 10
  63.              Window Modes  . . . . . . . . . . . . . . . . . . . . 11
  64.                Defaults  . . . . . . . . . . . . . . . . . . . . . 11
  65.                SetWindowModes  . . . . . . . . . . . . . . . . . . 12
  66.                List of Modes . . . . . . . . . . . . . . . . . . . 12
  67.                Shadows . . . . . . . . . . . . . . . . . . . . . . 13
  68.                ZoomMode  . . . . . . . . . . . . . . . . . . . . . 13
  69.                RelMode . . . . . . . . . . . . . . . . . . . . . . 13
  70.                PermMode  . . . . . . . . . . . . . . . . . . . . . 14
  71.                SeeThruMode . . . . . . . . . . . . . . . . . . . . 14
  72.                HiddenMode  . . . . . . . . . . . . . . . . . . . . 15
  73.                VirtualMode . . . . . . . . . . . . . . . . . . . . 15
  74.              Cursor Modes  . . . . . . . . . . . . . . . . . . . . 16
  75.  
  76.         4. WRITING TO WINDOWS  . . . . . . . . . . . . . . . . . . 18
  77.              Direct Writing  . . . . . . . . . . . . . . . . . . . 18
  78.              Cursor and EOS Positioning  . . . . . . . . . . . . . 19
  79.              Clearing  . . . . . . . . . . . . . . . . . . . . . . 19
  80.              Scrolling . . . . . . . . . . . . . . . . . . . . . . 21
  81.              Line Drawing  . . . . . . . . . . . . . . . . . . . . 21
  82.              Custom Routines . . . . . . . . . . . . . . . . . . . 22
  83.  
  84.         5. VIRTUAL WINDOWS . . . . . . . . . . . . . . . . . . . . 24
  85.              Application . . . . . . . . . . . . . . . . . . . . . 24
  86.              Programming . . . . . . . . . . . . . . . . . . . . . 24
  87.  
  88.         6. WINDOW MANAGEMENT . . . . . . . . . . . . . . . . . . . 28
  89.              Access Methods  . . . . . . . . . . . . . . . . . . . 28
  90.              Display Control . . . . . . . . . . . . . . . . . . . 28
  91.              Write Control . . . . . . . . . . . . . . . . . . . . 29
  92.              Window Modes and Flags  . . . . . . . . . . . . . . . 30
  93.              High Speed Screen Design  . . . . . . . . . . . . . . 30
  94.              Multiple Video Pages  . . . . . . . . . . . . . . . . 31
  95.              Multi-Tasking Environments  . . . . . . . . . . . . . 31
  96.  
  97.         7. DATA MANAGEMENT . . . . . . . . . . . . . . . . . . . . 33
  98.              Data Allocation . . . . . . . . . . . . . . . . . . . 33
  99.  
  100.  
  101.                                        2
  102.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  103.  
  104.  
  105.              Record Handling . . . . . . . . . . . . . . . . . . . 33
  106.  
  107.         8. UTILITY UNITS . . . . . . . . . . . . . . . . . . . . . 36
  108.              Goof Unit . . . . . . . . . . . . . . . . . . . . . . 36
  109.              Wutil Unit  . . . . . . . . . . . . . . . . . . . . . 36
  110.  
  111.         APPENDIX A: Application Products . . . . . . . . . . . . . 39
  112.  
  113.         APPENDIX B: Revision History . . . . . . . . . . . . . . . 49
  114.  
  115.         APPENDIX C: Credits  . . . . . . . . . . . . . . . . . . . 51
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.                                        3
  163.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  164.  
  165.  
  166.    1.  I N T R O D U C T I O N
  167.  
  168.  
  169.    FEATURES
  170.  
  171.    Welcome to WNDW multi-level virtual windows!
  172.  
  173.    You have just obtained a copy of the highest performance window utilities 
  174.    available today for Borland Pascal 7.0 (BP7).  Both novice and professional 
  175.    programmers will appreciate these simple and very powerful utilities that 
  176.    gives you full window control and management in all text modes.  WNDW is 
  177.    ideal for small projects that require small code size.
  178.    
  179.    Here are some of the features you will discover:
  180.  
  181.      . Uses the powerful direct screen writing routines of 
  182.        QWIK71.
  183.      . Works in DOS and DPMI.
  184.      . Up to 254 fixed or virtual windows can be on the screen at 
  185.        one time.
  186.      . Extremely high-speed virtual screens in RAM.
  187.      . Virtual windows are fully updated even if covered!
  188.      . Virtual windows have virtual titles.
  189.      . Fully supported hidden windows saved in RAM.
  190.      . Fully supports all video pages.
  191.      . Adjustable-rate moving, resizing, and scrolling.
  192.      . All windows can be randomly accessed.
  193.      . 28 window-relative writing routines.
  194.      . 15 different border styles with shadows.
  195.      . Full line drawing procedures.
  196.      . Full cursor mode control for each window.
  197.      . Writes in all text modes and column modes.
  198.      . Writes direct to multi-tasking video buffers (MTVB).
  199.      . Only 13k bytes of code if all 69 utilities are used.
  200.      . Used in all other Eagle products.
  201.  
  202.    WNDW is a very high performance window unit with high speed and tight code.  
  203.    All types of windows, including fixed or virtual, hidden or shown, work 
  204.    compatibly in the same package.  With WNDW, you can choose the absolute 
  205.    writing routines of QWIK, the window-relative writing routines of WNDW, and 
  206.    even customize your own.
  207.  
  208.  
  209.    USING THE MANUALS
  210.  
  211.    Disk Based Guides - The manuals for WNDW are on disk so that you can 
  212.    conveniently scan for the topic you are seeking.  You can do this with any 
  213.    list or search utility with a search function.  You can also make a printed 
  214.    copy.  If you have not already printed this manual, refer to the READ.ME 
  215.    file for instructions.  At the present time, no bound manuals are being 
  216.    offered with registration.
  217.  
  218.    User's Guide - This manual, the one your are reading now, assumes that as a 
  219.    programmer you are already familiar with Borland Pascal 7.0, and that you 
  220.    have a working knowledge of your disk operating system (DOS).  It also 
  221.  
  222.  
  223.    Chapter 1, Introduction                                             Page 4
  224.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  225.  
  226.  
  227.    assumes that you are familiar with QWIK screen utilities in QWIK71.ZIP.
  228.    This manual will provide the basic instructions for creating and managing  
  229.    multi-level windows.  You can even copy examples from this file direct to 
  230.    the Turbo editor for testing.
  231.  
  232.    Reference Guide - This manual describes in detail all procedures, functions 
  233.    and variables used in WNDW.  It is alphabetically arranged for easy access 
  234.    in a format similar to the BP7 manual.  Use this manual when you have 
  235.    become familiar with the basic principles in the User's guide.
  236.  
  237.  
  238.    LICENSING
  239.  
  240.    Registration - These routines and the documentation have been released for 
  241.    distribution as Shareware.  You have been given the chance to sample the 
  242.    full capability of WNDW without risk!  If you find that WNDW is a valuable 
  243.    tool, then you are expected to register.  You will find a reasonable 
  244.    licensing schedule found in LICENSE.ZIP to meet private or commercial 
  245.    needs.  When registering, be sure to specify the version for Borland Pascal    
  246.    (such as TP6 or BP7) you wish to receive.  Please specify your disk size as 
  247.    well.
  248.  
  249.    Source Code - All registered users will receive source code when the signed 
  250.    license agreement is returned with the registration.  All source code 
  251.    compiles under BP7 as well as TP7.  The compiled units in the distributed 
  252.    file were compiled with TP/BP7 and only work under this version.
  253.  
  254.  
  255.    CUSTOMER SERVICE
  256.    If you have questions, comments, or suggestions, the Eagle can be contacted 
  257.    by four means - (1) CompuServe, (2) telephone, (3) The Eagle BBS, or 
  258.    (4) mail.
  259.  
  260.    CompuServe - The most dependable way to contact the Eagle is through Compu-
  261.    Serve.  James (Jim) H. LeMay has written the TP7 version of WNDW and can be 
  262.    contacted using CIS mail with the CIS ID of 76011,217.
  263.  
  264.    Telephone - Jim can also be reached by phone at (817) 735-4833 on weekdays 
  265.    from 9:00 a.m. to 5:00 p.m CST.
  266.  
  267.    The Eagle BBS - You can also contact us on our 24-hour BBS at (214) 539- 
  268.    9878, Intel 1200/2400/9600/14400 N81 V.42 MNP5.
  269.  
  270.    Mail - For registration or problems, please write:
  271.  
  272.        Eagle Performance Software
  273.        6341 Klamath Road
  274.        Ft. Worth, TX 76116-1617
  275.  
  276.    In your written request for resolving problems, be sure to include:
  277.  
  278.      . A diskette with compilable source code of the problem.
  279.      . The Eagle product and version number.
  280.      . The computer make and model.
  281.      . The type of video card, video monitor and keyboard.
  282.  
  283.  
  284.    Chapter 1, Introduction                                             Page 5
  285.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  286.  
  287.  
  288.    ASP
  289.  
  290.    QWIK is a shareware program conforming to the standards of the Association 
  291.    of Shareware Professionals (ASP).  You can get more information about ASP 
  292.    by writing to:
  293.     
  294.      Association of Shareware Professionals
  295.      P.O. Box 5786
  296.      Bellevue,WA 98006
  297.  
  298.    This program is produced by a member of the Association of Shareware 
  299.    Professionals (ASP).  ASP wants to make sure that the shareware principle 
  300.    works for you.  If you are unable to resolve a shareware-related problem 
  301.    with an ASP member by contacting the member directly, ASP may be able to 
  302.    help.  The ASP Ombudsman can help you resolve a dispute or problem with an 
  303.    ASP member, but does not provide technical support for member's products.  
  304.    Please write to:
  305.  
  306.      ASP Ombudsman
  307.      P.O. Box 5786
  308.      Bellevue,WA 98006
  309.  
  310.    or send a CompuServe message via EasyPlex to ASP Ombudsman 70007,3536.
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.    Chapter 1, Introduction                                             Page 6
  346.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  347.  
  348.  
  349.    2.  G E T T I N G   S T A R T E D
  350.  
  351.    This section will acquaint you with the files on distribution disk and show 
  352.    you a couple of demonstrations to quickly see what WNDW can accomplish.
  353.  
  354.  
  355.    DISTRIBUTION FILES
  356.  
  357.    In this version, WNDW70A.ZIP contains:
  358.  
  359.      Read    .me:   Note of printing instructions for manual.
  360.      KeyB    .tpp:  Keyboard unit for WNDWMGR.PAS demo for DPMI.
  361.      KeyB    .tpu:  Keyboard unit for WNDWMGR.PAS demo for DOS.
  362.      Goof    .pas:  Unit to display errors.
  363.      Qwik71  .tpp:  Unit for quick screen writing for DPMI.
  364.      Qwik71  .tpu:  Unit for quick screen writing for DOS.
  365.      Strs    .pas:  Unit from QWIK71 for number-to-string conversions.
  366.      Wutil   .tpp:  Independent utilities unit used in WNDW for DPMI.
  367.      Wutil   .tpu:  Independent utilities unit used in WNDW for DOS.
  368.      W70-var .inc:  Actual source code which lists all of the types, 
  369.                     constants, and variables used for WNDW70A.
  370.      Wndw70a-.pas:  Shows the interface portion of WNDW70A.
  371.      Wndw70a .tpp:  DPMI version of WNDW70A.
  372.      Wndw70a .tpu:  This unit has all features enabled.  Please note 
  373.                     that MaxWndw, MaxVirtualWndw, MaxPageUsed, and the 
  374.                     WindowNames names have all been preassigned.  To 
  375.                     make any changes in the data structure, the 
  376.                     complete source code will be required. 
  377.      Wndw70a .doc:  This document - a user's guide to WNDW.
  378.      WndwRef .doc:  WNDW Reference Guide document covering each 
  379.                     routine and variable in detail.
  380.      WndwDemo.pas:  Demo of WNDW70A and QWIK71 which shows screen
  381.                     design performance.
  382.      WndwMgr .pas:  Demo of full window management.
  383.      License .zip:  ZIP file containing license agreement and ordering 
  384.                     details.
  385.  
  386.  
  387.    DEMONSTRATION
  388.  
  389.    To get the feeling of the speed and features of WNDW, let's run the    
  390.    demonstrat ion programs that came with the utilities.  For DOS, do the 
  391.    following steps:
  392.  
  393.      1. Copy QWIK71.TPU to QWIK.TPU.  
  394.      2. Copy WNDW70A.TPU to WNDW.TPU
  395.      3. If you are running programs in a multi-tasking 
  396.         environment, instruct the environment that you are NOT 
  397.         writing direct to the screen.  Also set text pages to 2.
  398.      4. Make, compile and run WNDWDEMO.PAS to get a feel for 
  399.         screen design performance and speed.  
  400.      5. Make, compile and run WNDWMGR.PAS to get a feel for true 
  401.         virtual windows and window management.  Press Alt-1 to 
  402.         access the bottom window.  With Scroll Lock on, it can be 
  403.         moved, resized and scrolled.
  404.  
  405.  
  406.    Chapter 2, Getting Started                                          Page 7
  407.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  408.  
  409.  
  410.    3.  P R O G R A M M I N G   W I N D O W S
  411.  
  412.    This sections will get you familiar with the basics of window programming 
  413.    by starting with very basic windows and then taking you step-by-step 
  414.    through the variety of options and modes that are available.
  415.  
  416.  
  417.    BASIC PROGRAMMING
  418.  
  419.    First Program - Let's write a short program to see how simple it is to 
  420.    write with WNDW.  While in the TP editor, enter the following code:
  421.  
  422.      EXAMPLE 1:  Your first window
  423.      ----------------------------------------------------------------------
  424.      {$M 16384,8000,8000 }                                                 
  425.      uses Crt,Qwik,Wndw,Goof;
  426.      begin
  427.        InitWindow (LightGrayBG,true);    { Initialize and Clear window }
  428.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,aWindow);
  429.        WWriteC (7,'Making windows is easy!');
  430.      end.
  431.  
  432.    Assuming you have already copied QWIK71.TPU to QWIK.TPU and WNDW70A.TPU to    
  433.    WNDW.TPU, make and run the code.  You can then see these results:
  434.  
  435.       . The base window is cleared with Black on LightGray attributes.
  436.       . The window is placed at absolute row 5, column 20
  437.       . The window size is 15 rows high and 40 columns wide.
  438.       . The window text color is White on a Blue background.
  439.       . The window border color is Cyan on a Blue background.
  440.       . The border is the Single line width style.
  441.       . The window name is aWindow.
  442.       . The message was centered on window-relative row 7.
  443.       
  444.    Row/Col vs. X/Y - You probably noticed that the row parameter is first and 
  445.    the column parameter is second.  Since WNDW is entirely for text modes, it 
  446.    is more intuitive to specify the row first and the column second just like 
  447.    any word processor.  The X/Y scheme is better suited for graphics.
  448.  
  449.    Attributes - Notice that our example uses the constant "BlueBG".  WNDW uses 
  450.    QWIK which provides eight convenient background color constants to use 
  451.    along with Turbo's 16 foreground colors.  The same names are used, but the 
  452.    "BG" suffix is added: 
  453.  
  454.       BlackBG       RedBG
  455.       BlueBG        MagentaBG
  456.       GreenBG       BrownBG
  457.       CyanBG        LightGrayBG
  458.  
  459.    These allow WNDW to make the most of Turbo's constant folding.  By simply 
  460.    adding the foreground and background constants together, the compiler saves 
  461.    the result as a single word.  And, by simply reading the MakeWindow 
  462.    statement, what you see is what you get (WYSIWYG). 
  463.  
  464.    Protected Underlay - That first program was pretty simple wasn't it?  
  465.  
  466.  
  467.    Chapter 3, Programming Windows                                      Page 8
  468.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  469.  
  470.  
  471.    Several things happened that you probably didn't notice.  The area under 
  472.    the window, called the underlay, was actually saved.  Later on when the 
  473.    window is no longer needed, it can be removed by restoring the underlay.  
  474.    This makes it just like a sheet of paper on a desk.  Let's add some 
  475.    statements to show if the underlay is really protected.  In addition, let's 
  476.    add a little more pizazz to the window by adding a shadow, zoom effect, and 
  477.    a title:
  478.  
  479.      EXAMPLE 2:  Protected underlay
  480.      ----------------------------------------------------------------------
  481.      {$M 16384,8000,8000 }
  482.      uses Crt,Qwik,Wndw,Goof;
  483.      begin
  484.        InitWindow (LightGrayBG,true); 
  485.        WWriteC (12,'Base Window');
  486.        SetWindowModes (ZoomMode+ShadowRight);
  487.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,aWindow);
  488.        TitleWindow (Top,Left,Yellow+BlueBG,' My First Window ');
  489.        WWriteC (7,'Making windows is easy!');
  490.        delay (2000);
  491.        RemoveWindow;   { Remove the window and restore underlay. }
  492.      end.
  493.  
  494.    Did you see that the message "Base Window" was still there?  In fact that 
  495.    entire underlay was protected because it was saved in the heap while we 
  496.    were writing on the CRT.  In addition:
  497.  
  498.       . The window modes controlled the Shadow and Zoom effect.
  499.       . The title is placed on the Top border, Left justified, with Yellow
  500.         on Blue attributes.
  501.       . The "Base Window" message was centered on window-relative row 12.
  502.  
  503.    Basic Principles - Was that simple enough for you?  Well, you'll be glad to 
  504.    know that you have already tried all the basic principles to making 
  505.    windows.  And the rest is just that easy.  But you haven't seen anything 
  506.    yet.
  507.  
  508.  
  509.    WINDOW DEFINITIONS
  510.  
  511.    Window - Just what is a window anyway?  It's an area reserved on the screen 
  512.    as a frame of reference to write text.  Right on the screen, the power of 
  513.    this program allows you to move, rearrange, hide, move, and resize, without 
  514.    losing any data.
  515.  
  516.    View - In virtual windows, this window text area is also called the view.  
  517.    More about virtual windows is explained later.
  518.  
  519.    Border - The border is the lines surrounding the window or view to clearly 
  520.    separate the window contents from other areas of the CRT.  However, a 
  521.    window does not require a border.
  522.  
  523.    Title - Conveniently, a window can be titled on the border - either the top 
  524.    or the bottom.  The title area extends the full length of the window not 
  525.    including the two vertical borders.  The title is written at a border-
  526.  
  527.  
  528.    Chapter 3, Programming Windows                                      Page 9
  529.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  530.  
  531.  
  532.    relative location.  If a window does not have a border, then the title area 
  533.    is just the top or bottom row of the window text area.
  534.  
  535.    Cursor - Each window has its own cursor location and mode (shape).
  536.  
  537.    Shadow - To give a window that off-the-screen appearance, a shadow can be 
  538.    added onto the outer edge of the window or window border.  There are two 
  539.    types of shadows.  They can be opaque or transparent.
  540.  
  541.    Generally Speaking - Throughout this document, the word "window" will 
  542.    loosely refer to all of the above parts as the full window.  It should be 
  543.    understood that all writing to the windows uses coordinates relative to the 
  544.    upper left corner of the window text area which is (1,1) exclusive of the 
  545.    border.
  546.  
  547.  
  548.    BASIC ROUTINES
  549.  
  550.    Basic Routines - There are five basic procedures that are fundamental to 
  551.    creating multi-level windows:
  552.          
  553.      InitWindow     - Initializes global data for the program.
  554.      SetWindowModes - Determines what types of windows are made.
  555.      MakeWindow     - Creates the window.
  556.      TitleWindow    - Places titles on the window.
  557.      RemoveWindow   - Removes window from CRT and memory.
  558.  
  559.    InitWindow - First, before any window procedures are used, InitWindow 
  560.    should be executed to initialize all global data for the entire program.  
  561.    It only needs to be done once.  
  562.           
  563.      InitWindow (Wattr: integer; ClearScr: boolean)
  564.  
  565.    The initial base window has no border and the window attribute is Wattr.  
  566.    You can optionally clear the window by setting ClearScr to TRUE.  The 
  567.    procedure initializes over 50 variables.  For details, you can examine the 
  568.    source code.
  569.  
  570.  
  571.    MAKEWINDOW PARAMETERS
  572.  
  573.    Declaration - The MakeWindow procedure actually makes the window on the 
  574.    screen.  Let's take a look at its declaration:
  575.  
  576.       MakeWindow (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
  577.                   BrdrSel: Borders; WindowName: WindowNames)
  578.  
  579.    The procedure's parameters control location, size, attributes, border 
  580.    style, and window name.  Notice that the size is expressed as Rows/Cols 
  581.    rather than another (Row2,Col2) coordinate.  This makes it very easy to 
  582.    change the location without having to recalculate the size.  
  583.  
  584.    Self-Centering Window - There is a very simple method to self-center a 
  585.    window on a screen - simply set the appropriate Row and/or Col parameter to 
  586.    0.  If Row is 0, the window will be centered to the current height of the 
  587.  
  588.  
  589.    Chapter 3, Programming Windows                                      Page 10
  590.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  591.  
  592.  
  593.    screen.  Likewise, if Col is 0, it will be centered horizontally.  So 
  594.    there's no need to calculate sizes!  This also works for RelMode which will 
  595.    be discussed later.
  596.  
  597.    Attributes - Wattr and Battr are the attributes for the window text area 
  598.    and border, respectively.  The attributes that are recognized are the same 
  599.    ones used in QWIK - even SameAttr is supported.
  600.  
  601.    Border Styles - There are 15 different border styles that can be used for 
  602.    the border, including two custom borders and even no border at all.  Here 
  603.    is the list of Border names that are predefined:
  604.  
  605.      NoBrdr         - No border at all.  Just the text area.
  606.      BlankBrdr      - Blank character on all sides.
  607.      SingleBrdr     - Single lines on all sides.
  608.      DoubleBrdr     - Double lines on all sides.
  609.      HdoubleBrdr    - Horizontal double lines.  Single vertical lines.
  610.      VdoubleBrdr    - Vertical double lines.  Single horizontal lines.
  611.      SolidBrdr      - Solid box character on all sides.
  612.      EvenSolidBrdr  - Vertical solid box.  Horizontal half box.
  613.      ThinSolidBrdr1 - Half box on all sides.  Squeezed horizontally.
  614.      ThinSolidBrdr2 - Half box on all sides.  Squeezed vertically.
  615.      LhatchBrdr     - Light hatch character on all sides.
  616.      MhatchBrdr     - Medium hatch character on all sides.
  617.      HhatchBrdr     - Heavy hatch character on all sides.
  618.      UserBrdr1      - User defined border.
  619.      UserBrdr2      - User defined border.
  620.  
  621.    All of the borders except the user borders are reserved for use in future 
  622.    Eagle products.  UserBrdr1 and UserBrdr2 may be customized to your needs.  
  623.    Each border has 15 different parts for the line drawing set including tees 
  624.    and interior lines.
  625.  
  626.    Tip: Hatch Borders - Since MDA and VGA both use a 9x16 character cell size, 
  627.    the hatch characters (ASCII 176, 177, 178) are only 8x16 in a 9x16 cell.  
  628.    This unfortunately produces a horizontal gap between the characters not 
  629.    seen on the CGA.  Be aware of the effect.
  630.  
  631.    Window Name - The name of each window should be different in order to 
  632.    uniquely identify the window for window management.  But since our simple 
  633.    test program only displayed the window momentarily, the window name is not 
  634.    significant and did not need to be unique.  So, the generic name "aWindow" 
  635.    was used.  The name Window0 is used to identify the initial base window 
  636.    which is the full CRT screen.
  637.  
  638.  
  639.    WINDOW MODES
  640.  
  641.    Defaults - Without needing to specify anything, the window is created with 
  642.    several defaults.  Let's see what they are:
  643.  
  644.      . Fixed size and placed absolute to the CRT.
  645.      . Shown on the CRT.
  646.      . The underlay is saved.
  647.      . No shadow or zoom effect.
  648.  
  649.  
  650.    Chapter 3, Programming Windows                                      Page 11
  651.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  652.  
  653.  
  654.      . No virtual screen.
  655.      . Cursor is turned on with the default cursor mode.
  656.      . Window is cleared.
  657.      . Moving and Accessing is permitted.
  658.  
  659.    Well, if these are all defaults, then that means they can be changed.  And 
  660.    they can.  We've already found out how to add shadow and zoom.  Let's try 
  661.    changing some others and see what happens.  Enter the following code into 
  662.    the editor:
  663.  
  664.      EXAMPLE 3:  Different modes and a hidden window
  665.      ----------------------------------------------------------------------
  666.      {$M 16384,8000,8000 }
  667.      uses Crt,Qwik,Wndw,Goof;
  668.      begin
  669.        InitWindow (LightGrayBG,true);
  670.        SetWindowModes (HiddenMode or ZoomMode or CursorOffMode);
  671.        MakeWindow (0,0,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  672.        WWriteC (12,'Where is it?');
  673.        WriteToHidden (Window1);     { Write to the hidden window.}
  674.        TitleWindow (Bottom,Right,Yellow+BlueBG,' My Second Window ');
  675.        WWriteC (3,'Here it is ...');
  676.        WBrdrH (7);                  { Add an extra horizontal border.}
  677.        WWriteC (10,'It was hidden!');
  678.        delay (2000);
  679.        ShowWindow (Window1);        { Put it back on the screen. }
  680.        delay (2000);
  681.        RemoveWindow;
  682.      end.
  683.  
  684.    When you run it, the window is immediately created.  But instead we see the 
  685.    message "Where is it?".  And to answer that question, the window was 
  686.    created in RAM instead of on the CRT.  In addition, the code also wrote 
  687.    messages direct to the hidden window.  The window remains hidden until it 
  688.    is called which we did with ShowWindow.  Afterward, we removed it from 
  689.    memory with RemoveWindow.  I'll bet you didn't know that you have already 
  690.    done some writing to a virtual screen.  That's right - the hidden window 
  691.    was a virtual screen!  Pretty easy, huh?  And it was done by simply setting 
  692.    a mode.  
  693.  
  694.    SetWindowModes - This procedure can be used any time prior to MakeWindow.  
  695.    It only needs to be done once since the value is retained in WindowModes 
  696.    until changed again.
  697.  
  698.    List of Modes - Did you notice the zoom effect this time and that the 
  699.    cursor was turned off?  Let's take a look at all the available modes:
  700.  
  701.      Mode Constant  Description
  702.      -------------  -----------------------------------------------
  703.      ShadowLeft     Shadow on the left side
  704.      ShadowRight    Shadow on the right side
  705.      ShadowTrans    Produces transparent rather than opaque shadows
  706.      ZoomMode       Zoom effect on Make, Show and AccessWindow
  707.      CursorOffMode  Leaves cursor off for window
  708.      RelMode        Window-relative frame of reference, no underlay
  709.  
  710.  
  711.    Chapter 3, Programming Windows                                      Page 12
  712.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  713.  
  714.  
  715.      PermMode       Can't be moved or removed, no underlay
  716.      SeeThruMode    Doesn't clear screen inside window
  717.      HiddenMode     Create window as hidden
  718.      VirtualMode    Create Virtual window and screen 
  719.      NoHideMode     Ignores request to hide window
  720.      NoAccessMode   Ignores request to access window
  721.      NoMoveMode     Ignores request to move/resize window
  722.  
  723.    We've already seen what the first four can do.  Let check to see what the 
  724.    others can do.
  725.  
  726.    ShadowLeft/ShadowRight - When placed on the CRT, the window gets a shadow 
  727.    on either the left or right side as well as the bottom.  For good human 
  728.    factors, it is recommended that the shadow only be used for the top window 
  729.    for clarity.  Opaque shadows are fully supported.  (However, transparent 
  730.    shadows are not currently supported in only one special case.  If a virtual 
  731.    window is updated underneath a window with a shadow, the transparent 
  732.    shadows will not be updated properly to show that the contents of the 
  733.    shadow have changed.)  Tip: Place windows with shadows correctly to prevent 
  734.    wrap-around.
  735.  
  736.    ShadowTrans - Normally shadows are opaque using the global variable 
  737.    ShadowChar and ShadowColor to create the effect.  However, when ShadowTrans 
  738.    mode is used, the shadows are transparent allowing underlying characters to 
  739.    show through.  With the ShadowTrans mode turned on, ShadowColor is used as 
  740.    the shadow color.
  741.  
  742.    ZoomMode - When a window is created, shown, or accessed on the CRT with 
  743.    this mode, it produces a zoom effect.  It is conveniently suppressed for 
  744.    hidden windows.
  745.  
  746.    RelMode - This is the simplest of all modes.  It enables you to set up a 
  747.    window within a window.  It simply overwrites the window, but produces a 
  748.    handy window-relative frame of reference to draw borders, write text or 
  749.    whatever.  It's a worry-free mode.  To get out of RelMode, you can simply 
  750.    switch to another window, or you can return to the parent window with 
  751.    RemoveWindow.  RelMode is only temporary and no stats are saved.  Let's 
  752.    modify the last example and try this out:
  753.  
  754.      EXAMPLE 4:  RelMode window
  755.      ----------------------------------------------------------------------
  756.      {$M 16384,8000,8000 }
  757.      uses Crt,Qwik,Wndw,Goof;
  758.      begin
  759.        InitWindow (LightGrayBG,true);
  760.        SetWindowModes (HiddenMode or ZoomMode or CursorOffMode);
  761.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  762.        WWriteC (12,'Where is it?');
  763.        WriteToHidden (Window1);     { Write to the hidden window.}
  764.        TitleWindow (Bottom,Right,Yellow+BlueBG,' My Second Window ');
  765.        SetWindowModes (RelMode);
  766.        MakeWindow (3, 0, 3,32,SameAttr,SameAttr,HdoubleBrdr,aWindow);
  767.        TitleWindow (Top,Center,SameAttr,' My Answer: ');
  768.        WWriteC (1,'Here it is ...');
  769.        delay (2000);
  770.  
  771.  
  772.    Chapter 3, Programming Windows                                      Page 13
  773.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  774.  
  775.  
  776.        ShowWindow (Window1);        { Put it back on the screen. }
  777.        WWriteC (10,'It was hidden!');
  778.      end.
  779.  
  780.    Notice that the (Row,Col) location was relative to the parent window, 
  781.    Window1.  Even the title as well as the text was placed in RelMode.  The 0 
  782.    value for Col centered it across the width of the window (not the screen).  
  783.    Once the window was shown, the window coordinates and modes were restored 
  784.    to the parent window.  The message appeared correctly on row 10 of the 
  785.    parent window.  Notice also that we didn't bother to use RemoveWindow since 
  786.    we were finished and wanted to take a closer look at what we created.
  787.  
  788.    PermMode - When creating your initial screen for a program, the underlay 
  789.    probably does not need to be saved.  This mode enables you to create 
  790.    windows without saving the underlay so the screen is simply overwritten  - 
  791.    perfect for initial screens by increasing speed and saving memory.  All the 
  792.    window stats are still saved for future use.  Keep in mind two rules for 
  793.    this mode.  First, all PermMode windows must be the first ones created.  
  794.    And second, use discretion when accessing the window to make sure it is not 
  795.    covered by another window before writing to it.  Let's try an example:
  796.  
  797.      EXAMPLE 5:  PermMode window
  798.      ----------------------------------------------------------------------
  799.      {$M 16384,8000,8000 }
  800.      uses Crt,Qwik,Wndw,Goof;
  801.      begin
  802.        InitWindow (LightGrayBG,false);   { No need to clear screen }
  803.        SetWindowModes (PermMode);
  804.        MakeWindow ( 1, 1,12,80,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  805.        TitleWindow (Top,Left,Yellow+BlueBG,' Input Window ');
  806.        MakeWindow (13, 1,13,80,White+GreenBG,GreenBG,HdoubleBrdr,Window2);
  807.        TitleWindow (Top,Left,Yellow+GreenBG,' Output Window ');
  808.        WWrite ( 1, 1,'Output data.');
  809.        AccessWindow (Window1);
  810.        WWrite ( 1, 1,'Input data.');
  811.      end.
  812.  
  813.    Since we were designing the initial screen, the ClearScr parameter in 
  814.    InitWindow was set to FALSE.  Did you notice that writing back to Window1 
  815.    was no problem?   You've just had your first shot at window management!  
  816.    AccessWindow will let you write to any window by name.  But if RemoveWindow 
  817.    is used on PermMode windows, the window record is simply dropped from the 
  818.    stack and the screen appears unaltered.
  819.  
  820.    SeeThruMode - If there is a portion of the current screen that needs to be 
  821.    captured to become a part of the window itself, this mode creates the 
  822.    border but simply skips clearing contents the window.  This is done only 
  823.    when the window is first created.
  824.  
  825.      EXAMPLE 6:  SeeThruMode window
  826.      ----------------------------------------------------------------------
  827.      {$M 16384,8000,8000 }
  828.      uses Crt,Qwik,Wndw,Goof;
  829.      begin
  830.        InitWindow (LightGrayBG,true); 
  831.  
  832.  
  833.    Chapter 3, Programming Windows                                      Page 14
  834.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  835.  
  836.  
  837.        WWriteC (12,'My message');
  838.        SetWindowModes (SeeThruMode);
  839.        MakeWindow (10,26, 5,30,White+BlueBG,Cyan+BlueBG,SingleBrdr,aWindow);
  840.        TitleWindow (Top,Left,Yellow+BlueBG,' Captured Text ');
  841.        delay (2000);
  842.        RemoveWindow;
  843.      end.
  844.  
  845.    When running this program, it appears that a border was just placed over 
  846.    the message "My message".  But in fact, it's really a part of the new top
  847.    window.  So, if the window is moved, the contents move as well.
  848.  
  849.    HiddenMode - In example 3, we plunged right into making hidden windows and 
  850.    it was easy, too.  As it was explained, the hidden window is actually a 
  851.    virtual window in the heap to which you can write at any time.  Since 
  852.    virtual screen writing is so very quick, you can even design full screens 
  853.    in an instant and then display them on the CRT.  Once a window is shown, it 
  854.    can always be hidden again with HideWindow.  This is explained further in 
  855.    Section 6 under Window Management.
  856.  
  857.    VirtualMode - This mode is very simple but powerful and enables you to 
  858.    create a virtual window.  A virtual screen is kept in RAM, but we can view 
  859.    any portion of it on the CRT.  As you would hope, it's still quite simple:
  860.  
  861.      EXAMPLE 7:  VirtualMode window
  862.      ----------------------------------------------------------------------
  863.      {$M 16384,8000,8000 }
  864.      uses Crt,Qwik,Wndw,Goof;
  865.      begin
  866.        InitWindow (LightGrayBG,true); 
  867.        SetWindowModes (VirtualMode);
  868.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  869.        WriteToVirtual (Window1);
  870.        TitleWindow (Top,Left,Yellow+BlueBG,' Virtual Window ');
  871.        WWrite ( 1, 1,'Upper left corner');
  872.        WWriteC (7,'This message is centered on the screen');
  873.        VUpdateWindow;            { Update the complete window on the CRT. }
  874.        WriteToCRT;               { Return to writing on the CRT. }
  875.      end.
  876.  
  877.    VUpdateWindow is the workhorse for virtual windows.  It copied a portion of 
  878.    the virtual screen, the virtual titles, and the cursor location back on the 
  879.    CRT.  You probably noticed that the long message seemed to be cut off.  But 
  880.    actually we are only looking at a portion of an 80x25 virtual screen.  So 
  881.    the message was indeed centered.  You can write direct to the virtual 
  882.    screen and view any portion you want.  We have just sampled some of the 
  883.    most powerful features of WNDW with very little effort.
  884.  
  885.    Restrictive Modes - NoHideMode, NoAccessMode, and NoMoveMode are modes that 
  886.    restrict window management.  These modes are covered in the Window 
  887.    Management section.
  888.  
  889.    Back to Defaults - What about getting back to the default modes after they 
  890.    have been changed?  Just use SetWindowModes (0).
  891.  
  892.  
  893.  
  894.    Chapter 3, Programming Windows                                      Page 15
  895.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  896.  
  897.  
  898.    Combinations - Just about any combination of modes can be put together.  
  899.    Just sum them together in the SetWindowModes procedure.  However, there are 
  900.    some combinations that will not be valid.  In fact, the procedure corrects 
  901.    your mistakes.  Here's a list of the modes showing invalid combinations:
  902.  
  903.      Set Mode       Invalid Combination With     Correction
  904.      -------------  ---------------------------  -------------------
  905.      ShadowLeft     ShadowRight                  ShadowRight
  906.      ShadowRight    ShadowLeft                   ShadowRight
  907.      ZoomMode       SeeThruMode                  Ignores ZoomMode
  908.      RelMode        Hidden, Virtual or PermMode  RelMode
  909.      PermMode       HiddenMode                   PermMode
  910.                     RelMode                      RelMode
  911.      SeeThruMode    ZoomMode                     Ignores ZoomMode
  912.      HiddenMode     RelMode or PermMode          RelMode or PermMode
  913.      VirtualMode    RelMode                      RelMode
  914.  
  915.  
  916.    CURSOR MODES
  917.  
  918.    Every Window - WNDW fully supports the cursor mode control of QWIK.  In 
  919.    fact, every window has its own cursor mode.  The setting is controlled by 
  920.    SetCursorDefault.  Here's how it works:
  921.  
  922.      EXAMPLE 8:  Cursor modes in each window
  923.      ----------------------------------------------------------------------
  924.      {$M 16384,8000,8000 }
  925.      uses Crt,Qwik,Wndw,Goof;
  926.      begin
  927.        InitWindow (LightGrayBG,true); 
  928.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  929.        SetCursorDefault (CursorBlock);
  930.        MakeWindow (9,30,15,40,White+BrownBG,BrownBG,EvenSolidBrdr,Window2);
  931.        WWrite ( 1, 1,'Upper left corner');
  932.        GotoEos;
  933.        delay (2000);
  934.        RemoveWindow;
  935.        delay (2000);
  936.        RemoveWindow;
  937.      end.
  938.  
  939.    When you ran this code, you noticed that top window had a block cursor.  
  940.    When the window was removed, the cursor mode was restored to new top 
  941.    window as an underline.  Just like SetWindowModes, the value is saved in 
  942.    CursorDefault until changed.
  943.  
  944.    Initialization - When WNDW is used, some initialization code tests the 
  945.    start up cursor mode.  On MDA cards, it corrects the improper CGA default.  
  946.    In addition, if the cursor is hidden, WNDW forces the cursor to an 
  947.    underline, but the original cursor is still in CursorInitial.
  948.  
  949.    Initial Window - InitWindow sets CursorDefault to the current cursor mode 
  950.    which is used for all subsequent windows and Window0.  If you even want 
  951.    Window0 to have a different cursor mode and default, simply use 
  952.    Qwik.SetCursor before InitWindow.
  953.  
  954.  
  955.    Chapter 3, Programming Windows                                      Page 16
  956.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  957.  
  958.  
  959.  
  960.    Mutiple PermMode Windows - If you have several PermMode windows, to get the
  961.    cursor to appear in one of the windows, you can use AccessWindow at any
  962.    time.  (Be sure that no other normal windows are covering it!)  If it also
  963.    has a virtual screen, you can also use the VUpdate routines at any time,
  964.    but only the last window accessed by AccessWindow or the like can display
  965.    the cursor.  This is controlled by the value of CrtWI.  As a short-cut, you
  966.    can also manually set CrtWI to the level index of the PermMode window you
  967.    want prior to a VUpdate routine such as:
  968.  
  969.      AccessWindow (Window2);     { Window 2 is permanent and virtual }
  970.      { ... }                     { CrtWI is equal to level of Window2 }
  971.      WriteToVirtual (Window3);   { Window 3 is permanent and virtual }
  972.      CrtWI := WI;                { Alter active window to current Window 3 }
  973.      VUpdateCursor;              { Now cursor appears in Window 3 not 2 }
  974.  
  975.  
  976.    CursorOffMode - So, what's the difference between using 
  977.    SetWindowModes(CursorOffMode) or SetCursorDefault(CursorOff)?  For 
  978.    technical reasons, in virtual windows, the cursor could be turned on and 
  979.    off.  If CursorOff is used, then the cursor could be turned on having an 
  980.    overbar cursor ($0000).  It's easier to use CursorOffMode.
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.    Chapter 3, Programming Windows                                      Page 17
  1017.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1018.  
  1019.  
  1020.    4.  W R I T I N G   T O   W I N D O W S 
  1021.  
  1022.    WNDW has several window-relative routines designed to write in the windows, 
  1023.    including direct writing, cursor and EOS positioning, clearing, scrolling, 
  1024.    and line drawing.  They work in all types of windows, including hidden and 
  1025.    virtual.  To do this, the routines access the top window record (TWS or 
  1026.    TopWndwStat) that keeps information about the current window.  For a 
  1027.    breakdown on the window record, see Data Structure in WNDWREF.DOC.  Each of 
  1028.    these groups of routines are discussed below.
  1029.  
  1030.  
  1031.    DIRECT WRITING
  1032.  
  1033.    Window Relative - Rather than using Qwrite to write to windows, three 
  1034.    routines are provided to use window-relative coordinates.  You have already 
  1035.    used two of them.  The attribute used is the window attribute TWS.WndwAttr.
  1036.  
  1037.      WWrite    (Row,Col: byte; aStr: string)
  1038.      WWriteC   (Row: byte; aStr: string)        
  1039.      WWriteA   (Row,Col: byte; Attr: integer; const aStr: string)
  1040.      WWriteAC  (Row: byte; Attr: integer; const aStr: string)
  1041.      WWriteSub (Row,Col: byte; SubStringLen: word; var Chars)
  1042.  
  1043.    WWriteC centers the string within the window while WWriteSub is for arrays 
  1044.    or substrings.  WWriteA and WWriteAC allow you to overide the current 
  1045.    window attribute.  These routines are actually procedures that interface the    
  1046.    QWIK routines using TWS.  These routines are so simple that you can create 
  1047.    several of your own using QWIK.  There is only one line of code.  For 
  1048.    example, here is the actual source code for WWriteA:
  1049.  
  1050.      procedure WWriteA (Row,Col: byte; Attr: integer; const aStr: string);
  1051.      begin
  1052.        with TopWndwStat do
  1053.          Qwrite (pred(Wrow+Row),pred(Wcol+Col),Attr,aStr);
  1054.      end;
  1055.  
  1056.    The only thing you have to do is add in the window-relative offsets Wrow 
  1057.    and Wcol.  Since there are several QWIK routines, you are free to make as 
  1058.    many routines as you like.
  1059.  
  1060.    QWIK Support - You will be pleased to know that QWIK is fully integrated 
  1061.    and supported in WNDW like your favorite use of SameAttr and the EOS 
  1062.    marker.  Wherever an attribute is needed, SameAttr can be used.  And all 
  1063.    the window-relative writing routines support the EOS.  For example, to 
  1064.    chain after a WWrite statement, just do the following:
  1065.  
  1066.      WWrite (1,2,'My message');
  1067.      QwriteEos (SameAttr,' is here');
  1068.  
  1069.    This would write the message "My message is here" on window-relative row 1, 
  1070.    column 2, also indicated as (1,2), with the current window attribute.
  1071.  
  1072.    Changing Attributes - Suppose you do not want to use the current window 
  1073.    attribute.  You could use WWwriteA.  But suppose you want to change it 
  1074.    temporarily.  How can it be altered?  The QwriteEos example above is one 
  1075.  
  1076.  
  1077.    Chapter 4, Writing To Windows                                       Page 18
  1078.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1079.  
  1080.  
  1081.    way.  But since the original window attribute is saved in TWS.OrigAttr, it 
  1082.    can be changed temporarily by doing the following:
  1083.  
  1084.      with TWS do
  1085.        begin
  1086.          WndwAttr := NewAttr;       { Assign new attribute }
  1087.          WWrite (1,1,'New Attribute'); 
  1088.          WndwAttr := OrigAttr;      { Restore window attribute }
  1089.        end;
  1090.  
  1091.  
  1092.    CURSOR AND EOS POSITIONING
  1093.  
  1094.    WNDW has eight routines to locate and move either the cursor or the EOS 
  1095.    marker relative to the current window.
  1096.  
  1097.  
  1098.    Cursor Location - Just like WhereR/WhereC, the following functions return 
  1099.    the current cursor location:
  1100.  
  1101.      WWhereR - Window-relative row.
  1102.      WWhereC - Window-relative column.
  1103.  
  1104.    Cursor Movement - Similar to GotoRC and GotoEos, the following procedures 
  1105.    move the cursor:
  1106.  
  1107.      WGotoRC  - Move to window-relative row and column.
  1108.      WGotoEos - Move cursor to match EOS marker location.
  1109.  
  1110.    So, what's the difference between GotoEos and WGotoEos?  The latter does 
  1111.    two more operations - (1) the cursor location is saved in TWS, and (2) the 
  1112.    cursor mode is tested in virtual windows to be turned on or off.  To be 
  1113.    consistent in windows, it is easier to use WGotoEos.
  1114.  
  1115.    EOS Location - Similar to EosR and EosC, the following functions return the 
  1116.    current EOS location:
  1117.  
  1118.      WEosR - Window-relative row.
  1119.      WEosC - Window-relative column.
  1120.  
  1121.    EOS Movement - Similar to EosToRC and QEosLn, the following procedures move 
  1122.    the EOS marker:
  1123.  
  1124.      WEosToRC - Move EOS to window-relative row and column.
  1125.      WEosLn   - Move EOS to column 1 of the next row with a possible 
  1126.                 scroll if past the last window row.
  1127.  
  1128.  
  1129.    CLEARING
  1130.  
  1131.    WNDW provides seven window-relative routines for clearing portions of the 
  1132.    window including lines, titles, fields, and even the full window with the 
  1133.    window attribute TWS.WndwAttr.  SameAttr becomes very handy when complex 
  1134.    attribute fields have already been designed into the window.
  1135.  
  1136.  
  1137.  
  1138.    Chapter 4, Writing To Windows                                       Page 19
  1139.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1140.  
  1141.  
  1142.      WClrScr      - Clears entire window.
  1143.      WClrTitle    - Clears entire title given Top or Bottom.
  1144.      WClrLine     - Clears an entire row.
  1145.      WClrEol      - Clears a row to End-Of-Line given a (Row,Col).
  1146.      WClrEos      - Clears a row from EOS to EOL.
  1147.      WClrField    - Clears a field given a (Row,Col).
  1148.      WClrFieldEos - Clears a field at EOS.
  1149.  
  1150.    Each of these procedures places the EOS marker at the beginning of the 
  1151.    cleared area for convenient chaining.  (WClrTitle does not alter EOS.)  The 
  1152.    latter four procedures also provide an optional attribute change.  Here are 
  1153.    some examples with a variety of ways to enter data using many of the above 
  1154.    window-relative routines:
  1155.  
  1156.      EXAMPLE 9:  Window-relative writing routines
  1157.      ----------------------------------------------------------------------
  1158.      {$M 16384,8000,8000 }
  1159.      uses Crt,Qwik,Strs,Wndw,Goof;
  1160.      var
  1161.        s1,s2,s3: string;
  1162.        r1,r2:    real;
  1163.        Ch: char;
  1164.      begin
  1165.        InitWindow (LightGrayBG,true);
  1166.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  1167.        s1 := ' a:\long\long\filename';
  1168.        s2 := ' a:\shorter\filename';
  1169.        s3 := ' error message';
  1170.        r1 := 1.0;
  1171.        r2 := 14.33e3;
  1172.        WWrite    ( 2, 2,'File name: ');
  1173.        WClrEos   (LightGrayBG);              { Clear first field }
  1174.        QwriteEos (SameAttr,s1);              { Put in file name }
  1175.        WWrite    ( 3, 2,'Status');
  1176.        WClrField ( 3,13,20,LightGrayBG);     { Clear second field }
  1177.        QwriteEos (SameAttr,s3);              { Put in status message }
  1178.        WWrite    ( 4, 2,'Quantity:  ');
  1179.        WClrFieldEos (20,LightGrayBG);        { Clear third field }
  1180.        QwriteEos (SameAttr,StrRFD(r1,19,1)); { Put in formatted data }
  1181.        EosToRCrel (0,-1);                    { Shift EOS back one space }
  1182.        WGotoEos;
  1183.        TitleWindow (Bottom,Center,Yellow+BlueBG+Blink,' Press any key ');
  1184.        repeat
  1185.          Ch := ReadKey;
  1186.        until Ch<>#00;
  1187.        WClrTitle (Bottom);
  1188.        TWS.WndwAttr := SameAttr;        { Keeps field attributes intact }
  1189.        WWrite  ( 2,13,s2);
  1190.        WClrEos (SameAttr);              { Clears remainder of long filename }
  1191.        WClrEol ( 3,13,SameAttr);        { Clears beyond field, But A OK! }
  1192.        WWrite  ( 4,13,StrRFD(r2,19,1)); { Overwrites new data }
  1193.        TWS.WndwAttr := TWS.OrigAttr;    { Restore window attribute }
  1194.      end.
  1195.  
  1196.    When running this example, the window will display the formatted data in 
  1197.  
  1198.  
  1199.    Chapter 4, Writing To Windows                                       Page 20
  1200.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1201.  
  1202.  
  1203.    their fields.  Then press a key as requested.  Then the fields are updated 
  1204.    with new data.  Notice that the fields are only overwritten and not cleared 
  1205.    first.  This produces the best human factors by appearing flawless.
  1206.  
  1207.  
  1208.    SCROLLING
  1209.  
  1210.    Some operations may require scrolling all or just portions of a window.  
  1211.    WNDW has four routines to do this, and, like all other WNDW routines, they 
  1212.    operate in all windows and video pages at the highest speed without flicker 
  1213.    or snow.
  1214.  
  1215.    Full Window - To scroll the entire window, two routines scroll the window 
  1216.    up or down.  You may also want to consider the conditional scroll of 
  1217.    WEosLn:
  1218.  
  1219.      WScrollUp   - Scrolls window up.
  1220.      WScrollDown - Scrolls window down.
  1221.  
  1222.    Partial Window - Just like InsLine and DelLine, these two routines insert 
  1223.    and delete lines by specifying the row.
  1224.  
  1225.      WDelLine - Deletes the specified row scrolling the remainder up.
  1226.      WInsLine - Inserts the specified row scrolling the remainder down.
  1227.  
  1228.  
  1229.    LINE DRAWING
  1230.  
  1231.    The border alone is not sufficient for the design of many windows that need 
  1232.    to be partitioned in a logical manner.  WNDW has six procedures to 
  1233.    completely partition any window - three are for extending the border and 
  1234.    three are for a separate line drawing set for inside the window.
  1235.  
  1236.    Border Drawing - The following procedures can easily add an extra partition 
  1237.    to the window by using the current border style (TWS.WSbrdr) and the border 
  1238.    attribute (TWS.BrdrAttr):
  1239.  
  1240.      WBrdrH    - draws a horizontal partition at the given row complete with 
  1241.                  tees.
  1242.      WBrdrV    - draws a vertical partition at the given columns complete with 
  1243.                  tees.
  1244.      WBrdrPart - places a single border part at the given row and column 
  1245.                  usually used for a cross or tee.
  1246.  
  1247.    Line Drawing - When a window is created, the line drawing set (TWS.WSline) 
  1248.    is the same as the border style (TWS.WSbrdr) but can freely be changed.  
  1249.    The following procedures can easily add an extra line within the window by 
  1250.    using the line drawing set and the current window attribute (TWS.WndwAttr):
  1251.  
  1252.      WLineH    - draws just a horizontal line at the given (Row,Col) repeated 
  1253.                  for a number of columns.
  1254.      WLineV    - draws just a vertical line at the given (Row,Col) repeated 
  1255.                  for a number of columns.
  1256.      WLinePart - places a single line part at the given row and column usually 
  1257.                  used for a cross or tee.
  1258.  
  1259.  
  1260.    Chapter 4, Writing To Windows                                       Page 21
  1261.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1262.  
  1263.  
  1264.  
  1265.    Acronyms - To make it easy to remember each individual part of a border or 
  1266.    line set, each part has its own acronym.  For example, BrdrTL means the Top 
  1267.    Left border part.  Here are the parts in their relative positions and their 
  1268.    definitions:
  1269.  
  1270.      Relative Position       The first letter of the border acronym mean:
  1271.      ------------------         T = top         B = bottom
  1272.      TL  TH  TT  TH  TR         V = vertical    H = horizontal
  1273.      LV      VL      RV         L = left        R = right
  1274.      LT  HL  CL  HL  RT         C = cross
  1275.      LV      VL      RV      The second letter is the same except for:
  1276.      BL  BH  BT  BH  BR         T = tee         L = line
  1277.  
  1278.  
  1279.    Example - Let's see if we can try some screen design with these routines 
  1280.    with this example:
  1281.  
  1282.      EXAMPLE 10:  Screen design
  1283.      ----------------------------------------------------------------------
  1284.      {$M 16384,8000,8000 }
  1285.      uses Crt,Qwik,Wndw,Goof;
  1286.      begin
  1287.        InitWindow (LightGrayBG,true);
  1288.        MakeWindow ( 5,19,17,41,GreenBG,White+GreenBG,VdoubleBrdr,Window1);
  1289.        TWS.WSline := SingleBrdr;   { Don't want VdoubleBrdr }
  1290.        WLineH ( 4, 1,TWS.Wcols);   { Use Wcols for full window width }
  1291.        WLineH (12, 1,TWS.Wcols);
  1292.        WBrdrH (8);
  1293.        WBrdrV (20);
  1294.        WBrdrPart ( 8,20,BrdrCL);   { For the Cross Line }
  1295.      end.
  1296.  
  1297.    When you see this executed, it is apparent that the borders are connected 
  1298.    with tees.  Notice that the line set uses the window attribute.  I'll bet 
  1299.    you didn't know screen design could be this easy!
  1300.  
  1301.  
  1302.    CUSTOM ROUTINES
  1303.  
  1304.    You can make your own custom routines to be window-relative by using the 
  1305.    current window record.  This topic will get you familiar with the window 
  1306.    coordinates and guide you through an example.
  1307.  
  1308.    Coordinates - The top (or active) window record has two sets of coordinates 
  1309.    - one set includes the border and the other excludes it.  Here are the 
  1310.    field identifiers for the ones including the border:
  1311.      
  1312.      WSrow  - Row of the top border.
  1313.      WScol  - Column of the left border.
  1314.      WSrows - Number of rows from border to border.
  1315.      WScols - Number of columns from border to border.
  1316.      WSrow2 - Row of the bottom border.
  1317.      WScol2 - Column of the right border.
  1318.  
  1319.  
  1320.  
  1321.    Chapter 4, Writing To Windows                                       Page 22
  1322.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1323.  
  1324.  
  1325.    The "WS" acronym means WndwStat which was used to create the window.  But 
  1326.    usually you would want the coordinate for the text window exclusive of the 
  1327.    border ("W" acronym) and here are those field identifiers:
  1328.  
  1329.      Wrow  - Top row of the window.
  1330.      Wcol  - Left column of the window.
  1331.      Wrows - Number of rows in the window.
  1332.      Wcols - Number of columns in the window.
  1333.      Wrow2 - Bottom row of the window.
  1334.      Wcol2 - Right column of the window.
  1335.  
  1336.    For example, to access the top row of the window, use TWS.Wrow.  This uses 
  1337.    the same amount of code as a simple variable.
  1338.  
  1339.    Example - You may have noticed that there is no Wfill procedure included in 
  1340.    WNDW.  That's because it's so simple to customize your own.  Let's try to 
  1341.    write one:
  1342.  
  1343.      procedure Wfill (Row,Col,Rows,Cols: byte; Ch: char);
  1344.      begin
  1345.        with TWS do   
  1346.          Qfill (pred(Wrow+Row),pred(Wcol+Col),Rows,Cols,WndwAttr,Ch);
  1347.      end.
  1348.  
  1349.    You can do the same to all your routines and they can work in any displayed 
  1350.    or hidden window, or even virtual screens.
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.    Chapter 4, Writing To Windows                                       Page 23
  1383.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1384.  
  1385.  
  1386.    5.  V I R T U A L  W I N D O W S
  1387.  
  1388.    Now that you have a good idea of what windows can do, virtual windows will 
  1389.    add a greater magnitude of power and flexibility to your windows with no 
  1390.    more effort than what has already been covered.  This section shows the 
  1391.    practical applications and how to program them.
  1392.  
  1393.  
  1394.    APPLICATION
  1395.  
  1396.    This topic will help you decide when virtual windows can meet the needs of 
  1397.    your programming application.
  1398.  
  1399.  
  1400.    More Power - The default mode for making windows is a fixed-size window 
  1401.    with all of the text displayed.  But what if you want variable sized 
  1402.    windows or want to write to windows that are not displayed or even covered?  
  1403.    Virtual windows to the rescue!  They handle this automatically.
  1404.  
  1405.    Definition - What is a virtual window anyway?  There are two parts to a 
  1406.    virtual window - the screen and the view.  The screen part is written in 
  1407.    RAM while the view is seen on the CRT.  So, we can write to the screen at 
  1408.    any time and show only a portion to the CRT as required!
  1409.  
  1410.    Advantages - Since QWIK has already developed low-level tools for virtual 
  1411.    screens, WNDW uses them to create quick virtual windows.  Here's the 
  1412.    advantages:
  1413.  
  1414.      . Variable row-by-column screen size up to 64k.
  1415.      . Extremely high speed in RAM.
  1416.      . Number of screens only limited by memory.
  1417.      . Can update windows even if they are overlapped, covered, or hidden.
  1418.      . The view can be resized without losing text.
  1419.      . The screen allows wraparound.
  1420.      . Can access any screen at any time.
  1421.  
  1422.    If your application has operations in one window that affects others, then 
  1423.    virtual windows are essential.  An example of this is the Turbo Debugger 
  1424.    environment where operations in the CPU window affect items in the source 
  1425.    code and watch windows.
  1426.  
  1427.  
  1428.    PROGRAMMING
  1429.  
  1430.    Remember, we already did some virtual window programming back in Example 7 
  1431.    and there wasn't anything to it.  Now, in this section, you will learn 
  1432.    additionally how to make, write, update, view, and resize a virtual window.
  1433.  
  1434.    Compiling - To include the virtual window code in the unit, the conditional 
  1435.    directive AddVirtual must be defined.  The distributed unit already has  
  1436.    defined it for you.  If you have the source code, the directive is found at 
  1437.    the top of WNDW55.PAS.  To eliminate the code when virtual windows are not 
  1438.    needed, simply remove the "$" in front of "Define AddVirtual".
  1439.  
  1440.    Creating - All we have to do to make a virtual window is use VirtualMode 
  1441.  
  1442.  
  1443.    Chapter 5, Virtual Windows                                          Page 24
  1444.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1445.  
  1446.  
  1447.    in the SetWindowModes procedure.  The default size for screen is the 
  1448.    current screen dimensions as set by InitWindow.  But suppose a different 
  1449.    size is needed.  How can that be changed?  SetVirtualSize controls the 
  1450.    screen size.  Here's an example:
  1451.  
  1452.      EXAMPLE 11:  Virtual window sizing
  1453.      ----------------------------------------------------------------------
  1454.      {$M 16384,10000,10000 }
  1455.      uses Crt,Qwik,Wndw,Goof;
  1456.      begin
  1457.        InitWindow (LightGrayBG,true);
  1458.        SetWindowModes (VirtualMode);
  1459.        SetVirtualSize (20,100);                   { 20 rows by 100 columns }
  1460.        MakeWindow (5,20,15,40,LightCyan+BlueBG,White+BlueBG,SingleBrdr,
  1461.                    Window1);
  1462.        WriteToVirtual (Window1);         { Now write to the virtual screen }
  1463.        Qfill (1,1,CRTrows,CRTcols,SameAttr,'?');   { Fill screen with data }
  1464.        TitleWindow (Top,Left,Yellow+BlueBG,' Virtual Window ');
  1465.        WWrite ( 4, 8,' >');                      { Let's get our bearings. }
  1466.        QwriteEos (TWS.WndwAttr+blink,'+');
  1467.        QwriteEos (SameAttr,'<- Row 4, Column 10 ');
  1468.        VUpdateWindow;             { Update the complete window on the CRT. }
  1469.        delay (2000);               { Make sure we see where the cursor is. }
  1470.        RemoveWindow;
  1471.      end.
  1472.  
  1473.    Notice that we chose a 20x100 screen, but what is seen on the CRT is only 
  1474.    15x40 which is set by MakeWindow.  So, MakeWindow sets the view size while 
  1475.    SetVirtualSize sets the screen size.
  1476.  
  1477.    Writing to the Screen - Since there are two areas to write on a virtual 
  1478.    window, the view and the screen, WNDW must be told where you intend to 
  1479.    place text.  Right after this MakeWindow procedure, it is assumed we are 
  1480.    going to continue to write on the CRT.  But the primary place to write is 
  1481.    the virtual screen.  WriteToVirtual selects that screen.  All subsequent 
  1482.    procedures will write to it - all QWIK routines, WNDW routines, and even 
  1483.    TitleWindow and MakeWindow.  It is treated just like any other screen.  The 
  1484.    exception of course is the cursor routines which must be handled by WNDW 
  1485.    routines only.
  1486.  
  1487.    RelMode - If you do write to the virtual screen and use MakeWindow, the 
  1488.    mode is forced into RelMode.  Otherwise, the window would be nested and 
  1489.    WNDW could not support it.
  1490.  
  1491.    Memory - What does the screen actually look like in memory?  It is saved in 
  1492.    the heap in the same way as a CRT video screen.  Technically, the far 
  1493.    pointer QScrPtr points to the location of the screen which is a contiguous 
  1494.    array of Character/Attribute words.  The last two rows past the screen are 
  1495.    reserved for the virtual titles which are seen on the CRT view when 
  1496.    updated.
  1497.  
  1498.    Writing to the View - It is possible to write direct to the view on the CRT 
  1499.    if desired.  To get back and write to the top view, use WriteToCRT and do 
  1500.    your writing.  But the next time this window is updated with VUpdateWindow 
  1501.    or the like, the view will be overwritten with the contents of the virtual 
  1502.  
  1503.  
  1504.    Chapter 5, Virtual Windows                                          Page 25
  1505.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1506.  
  1507.  
  1508.    screen.
  1509.  
  1510.    Updating - At some time, we would probably like to see the screen and we 
  1511.    can do this with any of five updating procedures.  The main workhorse is 
  1512.    VUpdateWindow which has been demonstrated several times.  This procedure is 
  1513.    so carefree is doesn't even matter when you use it.  It updates the virtual 
  1514.    window of the current name (TWS.WSname) no matter where it is - on top, 
  1515.    covered, overlayed, and even hidden from the CRT!  The routine actually 
  1516.    hunts for it and updates it.  To show how it can do this, let's modify the  
  1517.    last example:
  1518.  
  1519.      EXAMPLE 12:  Updating covered windows automatically
  1520.      ----------------------------------------------------------------------
  1521.      {$M 16384,12000,12000 }
  1522.      uses Crt,Qwik,Wndw,Goof;
  1523.      begin
  1524.        InitWindow (LightGrayBG,true);
  1525.        SetWindowModes (VirtualMode);
  1526.        SetVirtualSize (20,100);                   { 20 rows by 100 columns }
  1527.        MakeWindow (5,20,15,40,LightCyan+BlueBG,White+BlueBG,SingleBrdr,
  1528.                    Window1);
  1529.        SetWindowModes (0);                        { Back to default modes. }
  1530.        MakeWindow (7,30,16,18,White+GreenBG,GreenBG,DoubleBrdr,Window2);
  1531.        delay (2000);               { Make sure we see where the cursor is. }
  1532.        WriteToVirtual (Window1);         { Now write to the virtual screen }
  1533.        Qfill (1,1,CRTrows,CRTcols,SameAttr,'?');   { Fill screen with data }
  1534.        TitleWindow (Top,Left,Yellow+BlueBG,' Virtual Window ');
  1535.        WWrite ( 4, 8,' >');                      { Let's get our bearings. }
  1536.        QwriteEos (TWS.WndwAttr+blink,'+');
  1537.        QwriteEos (SameAttr,'<- Row 4, Column 10 ');
  1538.        VViewRC (4,10);
  1539.        VUpdateWindow;             { Update the complete window on the CRT. }
  1540.        delay (1000);
  1541.        RemoveWindow;
  1542.        delay (2000);               { Make sure we see where the cursor is. }
  1543.        RemoveWindow;
  1544.      end.
  1545.  
  1546.    With the delay inserted, it gives you time to clearly see that the covered 
  1547.    virtual window was updated even though it was covered by another window.  
  1548.    But that's not all.  When the window was removed, you could see that it was 
  1549.    fully updated even under the part that was covered!  That's the power of 
  1550.    virtual windows.
  1551.  
  1552.    Updating Routines - There are four other updating procedures that can be 
  1553.    chosen other than VUpdateWindow:
  1554.  
  1555.      VUpdateView   - Updates just the window contents.
  1556.      VUpdateTitles - Updates just the titles.
  1557.      VUpdateCursor - Updates new cursor position.
  1558.      VUpdateRows   - Updates selected rows on top view, but full view if 
  1559.                      covered.
  1560.  
  1561.    VUpdateWindow actually executes the first three.  But they are also 
  1562.    available as separate routines for more detailed work.  When the view is on 
  1563.  
  1564.  
  1565.    Chapter 5, Virtual Windows                                          Page 26
  1566.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1567.  
  1568.  
  1569.    top of the CRT or hidden, the routines are extremely quick.  VUpdateRows is 
  1570.    especially quick for items like data entry to the virtual screen.  If the 
  1571.    windows are covered, the procedures have to do more work.  Then 
  1572.    VUpdateWindow takes about the same time as either VUpdateTitles and 
  1573.    VUpdateView, so VUpdateWindow might as well be used.  VUpdateCursor is 
  1574.    almost a trivial routine in any case.
  1575.    
  1576.    Viewing - In this example, you may have noticed that the view was shifted a 
  1577.    bit compared to Example 11, and that the cursor was no longer in view.  It 
  1578.    was shifted by the viewing routine VViewRC.  In fact, we could view any 
  1579.    part of the screen.  Three routines can adjust the reference point of view 
  1580.    of the upper left corner:
  1581.  
  1582.      VViewRC     - Changes to a given (Row,Col).
  1583.      VViewRCrel  - Shifts a number of rows and columns, positive or negative.
  1584.      VScrollView - Shifts a number of rows and columns, and updates the just 
  1585.                    the view and accepts mouse stepped input.
  1586.  
  1587.    The first two only change the coordinates in the virtual window record, 
  1588.    while VScrollView updates the view as well.  VViewRCrel is actually a 
  1589.    subroutine of VScrollView.  All routines check for bounds and will keep the 
  1590.    view within screen limits.
  1591.  
  1592.    Resizing - If the virtual window is the top view, two routines can resize 
  1593.    it by shifting the lower right hand border:
  1594.  
  1595.      VResizeWindow - Shifts a number of rows and columns, and updates the 
  1596.                      entire window.  Accepts both row and column parameters 
  1597.                      which permit mouse stepped input.
  1598.      VZoomWindow   - Toggles window between full size and current size.  
  1599.                      Zooming up, the window is centered on the screen and the 
  1600.                      view is at (1,1).  Zooming down, it returns to the same 
  1601.                      size and location, but the view remains at (1,1).
  1602.  
  1603.    Both routines force writing to the CRT upon exit.  They also completely 
  1604.    update the window since the view and cursor may be shifted.  The titles are 
  1605.    also smoothly updated.  The zoom can be toggled back and forth as long as 
  1606.    it hasn't changed size or hasn't zoomed up another window.
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.    Chapter 5, Virtual Windows                                          Page 27
  1627.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1628.  
  1629.  
  1630.    6.  W I N D O W   M A N A G E M E N T
  1631.  
  1632.    Some of the previous examples have already touched on the principles of 
  1633.    window management.  Now this section provides the full scope of management 
  1634.    to access windows for display or writing, including multiple video pages.
  1635.  
  1636.  
  1637.    ACCESS METHODS
  1638.  
  1639.    The are two basic methods for accessing windows: serial access and random 
  1640.    access; WNDW does them both.
  1641.  
  1642.    Serial Access - This is a simple method of stacking windows over each other 
  1643.    and then removing them in reverse order.  Any writing is always done on the 
  1644.    top window displayed on the CRT.  The only two procedures used are 
  1645.    MakeWindow and RemoveWindow.  For simple menu systems, serial access may be 
  1646.    all that is needed.  The advantages are:
  1647.  
  1648.      . Uses less code.
  1649.      . No gaps in heap memory.
  1650.      . Only one place to write.
  1651.  
  1652.    But the disadvantages are many.  Once a window is removed, it is lost from 
  1653.    memory and must be recreated.  This can cause a significant amount of 
  1654.    shuffle to access other windows.  Serial access is a subset of random 
  1655.    access.
  1656.  
  1657.    Random Access - More and more applications require access to any window at 
  1658.    any time without losing the data.  WNDW was designed to handle this 
  1659.    automatically at very high speed.  The advantages to random access are:
  1660.  
  1661.      . Free access to any window.
  1662.      . Windows are created only once.
  1663.      . Virtual windows can be updated even if covered.
  1664.      . Ease of programming.
  1665.  
  1666.    Any window can be randomly accessed, including fixed, virtual and hidden 
  1667.    windows.  It's as simple as that.  Try running the window management demo 
  1668.    WNDWMGR.PAS again and see how you can hide, show, and access any window.
  1669.    The instructions are on the screen.
  1670.  
  1671.  
  1672.    DISPLAY CONTROL
  1673.  
  1674.    Three procedures select the window to be displayed as the top window:
  1675.  
  1676.      AccessWindow - Accesses the window by name whether hidden or covered.
  1677.      HideWindow   - Hides the top window.
  1678.      ShowWindow   - Shows a window given its name.
  1679.  
  1680.    AccessWindow hunts for the named window and, if it is hidden, it will also 
  1681.    be shown.  ShowWindow is actually a subroutine of AccessWindow.  Any window 
  1682.    (except PermMode) can be hidden and shown; they do not have to be created 
  1683.    with HiddenMode which hides it at the start.
  1684.  
  1685.  
  1686.  
  1687.    Chapter 6, Window Management                                        Page 28
  1688.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1689.  
  1690.  
  1691.    EOS - When using Hide/ShowWindow, the EOS is reset to (1,1) to prevent 
  1692.    unexpected results.  However, if the window is currently displayed on the 
  1693.    CRT and AccessWindow is used, the EOS is restored to its previous value.
  1694.  
  1695.    RemoveWindow - This procedure could be considered a form of display 
  1696.    control, but remember that when a window is removed, it is gone forever, 
  1697.    including any virtual screen.
  1698.  
  1699.    MoveWindow - This procedure shifts the top window around on the CRT by a 
  1700.    given number of rows and columns allowing mouse stepped control.  A window 
  1701.    can be limited in movement by setting the margins in MarginRec.  The bounds 
  1702.    are conveniently checked, so the window will always stay within limits.  In 
  1703.    the WNDWMGR.PAS demo, you can see the status line on row 25 is never 
  1704.    overlapped by MoveWindow.  Although Window0 is a permanent one, we could 
  1705.    easily write to the status line at anytime by using AccessWindow (Window0).
  1706.  
  1707.    Changing Borders - For human factors, it is often helpful to have a border 
  1708.    be emphasized when it becomes the new top window.  Two high speed 
  1709.    procedures handle this well:
  1710.  
  1711.      ChangeBorder  - Changes the top window to the new given border style.
  1712.      RestoreBorder - Restores the original border created with MakeWindow.
  1713.  
  1714.    Both of these procedures work only on the top window, and they can either 
  1715.    be fixed or virtual.  They replace all border parts including tees and also 
  1716.    leave all titles untouched.
  1717.  
  1718.  
  1719.    WRITE CONTROL
  1720.  
  1721.    Three procedures select where the writing procedures will write:
  1722.  
  1723.      WriteToHidden  - Writes to the named hidden window.
  1724.      WriteToVirtual - Writes to the named virtual screen.
  1725.      WriteToCRT     - Writes to the current top window on the CRT.
  1726.  
  1727.    WriteToHidden - A hidden window is saved with the border intact, but is 
  1728.    stripped of any shadow.  It is easier to use the window-relative writing 
  1729.    routines because of the optional border rather than using QWIK which can 
  1730.    still be used.  Any shadow is reconstructed by ShowWindow.
  1731.  
  1732.    WriteToVirtual - A virtual screen can freely use either WNDW or QWIK 
  1733.    routines since it never has a border.  If you want to write directly to the 
  1734.    virtual screen after it has just been created, sometimes it's easier to use 
  1735.    WriteToVirtual (TWS.WSname) provided HiddenMode was not used as well.
  1736.  
  1737.    WriteToCRT - All routines continue to write to their destination until 
  1738.    changed.  This routine will get you back to writing on the CRT.  Some 
  1739.    procedures are forced back to the CRT after their operation.  Here are 
  1740.    those exceptions:
  1741.  
  1742.      AccessWindow           VResizeWindow         MoveWindow
  1743.      HideWindow             VZoomWindow    
  1744.      ShowWindow             ChangeBorder   
  1745.      RemoveWindow           RestoreBorder  
  1746.  
  1747.  
  1748.    Chapter 6, Window Management                                        Page 29
  1749.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1750.  
  1751.  
  1752.  
  1753.    REMEMBER: Use WriteToCRT to get back to the CRT.  If you forget, the text 
  1754.    will of course be in an unexpected window.
  1755.  
  1756.    MakeWindow - This procedure does NOT force a change in the write 
  1757.    destination.  If you are writing to a hidden window or a virtual screen, 
  1758.    the resulting window created by MakeWindow is forced into RelMode.  
  1759.    However, the WindowModes setting is not affected.
  1760.  
  1761.  
  1762.    WINDOW MODES AND FLAGS
  1763.  
  1764.    Additional window modes are available to restrict window operations or to 
  1765.    detect the window destination status.  Each mode has a corresponding 
  1766.    boolean flag.
  1767.  
  1768.    Restrictive Modes - In some applications, you may want to restrict what the 
  1769.    end user can change for the windows.  Before the window is created with 
  1770.    MakeWindow, use these modes in SetWindowModes.  The flag can be used for 
  1771.    testing.
  1772.  
  1773.      Set Mode      Set Flag      Description
  1774.      ------------  ------------  --------------------------------------------
  1775.      NoHideMode    NoHideFlag    Ignores HideWindow operation.
  1776.      NoAccessMode  NoAccessFlag  Ignores AccessWindow operation.
  1777.      NoMoveMode    NoMoveFlag    Ignores MoveWindow/VResizeWindow operations.
  1778.  
  1779.  
  1780.    Destination Modes - These modes are just for your information and are 
  1781.    handled automatically by WNDW.  These identify the write destination of the 
  1782.    window.  You can use the flags for testing, but the modes are ignored by 
  1783.    SetWindowModes:
  1784.  
  1785.      Set Mode       Set Flag       Description
  1786.      -------------  -------------  ------------------------------
  1787.      ToCRTMode      ToCRTFlag      Writing to the CRT.
  1788.      ToHiddenMode   ToHiddenFlag   Writing to the hidden window.
  1789.      ToVirtualMode  ToVirtualFlag  Writing to the virtual screen.
  1790.  
  1791.  
  1792.    HIGH SPEED SCREEN DESIGN
  1793.  
  1794.    By using Hidden or Virtual windows, WNDW enables you to make screen design 
  1795.    several magnitudes faster than you ever thought possible.  
  1796.  
  1797.    Comparing Speeds - Let's compare three speeds - (1) Turbo's direct video, 
  1798.    (2) QWIK/WNDW writing to CRT, and (3) QWIK/WNDW writing to RAM.  The 
  1799.    following chart is striking.  
  1800.  
  1801.                         ---- QWIK/WNDW ----
  1802.      Video Card  Turbo  To CRT    To RAM
  1803.      ----------  -----  ------  ----------
  1804.      CGA         100%   225%    1600-4100%
  1805.      All others  100%   750%     900-1700%
  1806.  
  1807.  
  1808.  
  1809.    Chapter 6, Window Management                                        Page 30
  1810.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1811.  
  1812.  
  1813.    Design Strategy - So how can you get these fantastic speeds?  The simplest 
  1814.    way was shown in Example 3 by creating hidden windows.  You may wish to 
  1815.    make a habit of creating your windows with HiddenMode and then immediately 
  1816.    show them with ShowWindow.  Virtual window code is not even required for 
  1817.    hidden windows.  Of course, the alternative is to go ahead and use virtual 
  1818.    windows.  Either way, you can actually see the increase in performance in 
  1819.    your programs.
  1820.    
  1821.    Code Savings - Many application programs use disk-based screens that are 
  1822.    called from the disk when required.  QWIK and WNDW require such little code 
  1823.    to create a full screen design, that you will actually save code and disk 
  1824.    space by using these routines - not to mention the increase in speed!
  1825.  
  1826.  
  1827.    MULTIPLE VIDEO PAGES
  1828.  
  1829.    Most color video cards have the capacity for multiple video pages.  If your 
  1830.    application can benefit from extra pages, WNDW handles all the data records 
  1831.    with simplicity.
  1832.  
  1833.    Compiling - To include the multiple video page code in the unit, the 
  1834.    conditional directive MultiPage must be defined.  The distributed unit 
  1835.    already defines it for you.  If you have the source code, the directive is 
  1836.    found at the top of WNDW70A.PAS.  To eliminate the code when these pages 
  1837.    are not needed, simply remove the "$" in front of "Define MultiPage".
  1838.  
  1839.    Changing Pages - To change video pages, use one of the following 
  1840.    procedures:
  1841.  
  1842.      WriteToPage      - Directs all QWIK and WNDW routines to write to the 
  1843.                         given page number, but still view the current page.
  1844.      WriteAndViewPage - Directs all QWIK and WNDW routines to write and to 
  1845.                         view the given page number.
  1846.  
  1847.    Separate Records - Each video page has its own set of window records that 
  1848.    are completely separate including the level indexes and top window stats.  
  1849.    So when pages are swapped, everything is just where it was left - even the 
  1850.    cursor mode and EOS.  However, the virtual screen records use the same 
  1851.    array in the heap, but, to keep them separate, they do not share records.
  1852.  
  1853.  
  1854.    MULTI-TASKING ENVIRONMENTS
  1855.  
  1856.    WNDW is perfectly suited for working in multi-tasking environments.  In 
  1857.    order for your program to advantage of the speed and flexiblity of virtual 
  1858.    video buffers (MTVB) used with any environment, there is only one variable 
  1859.    that needs to be set:
  1860.  
  1861.      PreferMultiTask := true;
  1862.  
  1863.    Place this before InitWindow, and WNDW will use the MTVB if available.  All 
  1864.    routines will then be set to write directly to this buffer.  If InMultiTask 
  1865.    is true, then WNDW is using the MTVB.  Crt.DirectVideo is set false by WNDW 
  1866.    and you must likewise instruct the environment that the program is capable 
  1867.    of writing to the MTVB by telling it that is does not write direct to the 
  1868.  
  1869.  
  1870.    Chapter 6, Window Management                                        Page 31
  1871.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1872.  
  1873.  
  1874.    screen.  WNDW is extremely fast and proves itself well in environments!
  1875.  
  1876.    Multiple Pages - Please remember that many multi-tasking environments do 
  1877.    not support more than one page.  Be sure the ones you are designing around 
  1878.    do support full page control.  WNDW prevents the use of multiple pages 
  1879.    while using the MTVB by altering MaxValidPage in the InitPages procedure.  
  1880.    If you have one that behaves properly and you have the source code to WNDW, 
  1881.    you can enable multiple page writing by deleting the following line in 
  1882.    InitPages:
  1883.  
  1884.      If InMultiTask then
  1885.        MaxValidPage := 0;
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.    Chapter 6, Window Management                                        Page 32
  1932.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1933.  
  1934.  
  1935.    7.  D A T A   M A N A G E M E N T 
  1936.  
  1937.    Almost all of the data is handled automatically by WNDW.  This section is 
  1938.    provided for those who are interested in the details of data management and 
  1939.    the inner workings of WNDW.  The only required reading is Data Allocation.  
  1940.    Otherwise, you can skip this section.
  1941.  
  1942.  
  1943.    DATA ALLOCATION
  1944.  
  1945.    This topic will provide you enough knowledge to budget the number of data 
  1946.    records needed for you program using the constants MaxWndw, MaxVirualWndw, 
  1947.    and MaxPageUsed.
  1948.  
  1949.  
  1950.    Data Structure - For a detailed description of the data structure, you can 
  1951.    refer to Data Structure in Section 3 of WNDWREF.DOC.  To be able to adjust 
  1952.    the data structure, you must have the source code.  If not, the sizes have 
  1953.    been preassigned.
  1954.  
  1955.    MaxWndw - Each window on the CRT, displayed or hidden, requires one window 
  1956.    record of statistics called WndwStat which is global data.  The initial 
  1957.    window, Window0, is always at WndwStat[0].  They array of records is sized 
  1958.    by MaxWndw as the highest number of windows, hidden and displayed, that are 
  1959.    on the CRT at any one time on any one video page.   For example, if page 0 
  1960.    has a maximum of 10 windows and page 1 has 6, set MaxWndw equal to 10.
  1961.  
  1962.    MaxVirtualWndw - Each virtual window has two window records - one is in 
  1963.    WndwStat for the view and the other is in VirtualStat for the virtual 
  1964.    screen which is dynamic data.  The first virtual screen is saved in 
  1965.    VirtualStat[0] since it is zero based.  The array of records is sized by 
  1966.    MaxVirtualWndw as the highest total number of active virtual windows.  For 
  1967.    example, if page 0 has 4 virtual windows and page 1 also has 4, set 
  1968.    MaxVirtualWndw equal to 7 (not 8).
  1969.  
  1970.    MaxPageUsed - This is the highest page number that will be used in a 
  1971.    multiple video page program.  If you are only using page 0, which is 
  1972.    usually the case, you should go ahead and undefine the directive MultiPage 
  1973.    and not bother with MaxPageUsed.  Each page saves its own WndwStats and 
  1974.    Indexes in one record called PageStat in an array in dynamic memory.  
  1975.    MaxPageUsed and Qwik.MaxPage are compared and the lesser of the two will 
  1976.    size the PageStat array.
  1977.  
  1978.    Program Development - When you first start developing a program, make it 
  1979.    easy on yourself and inflate these constants to provide enough freedom 
  1980.    without having to recompile.  In your final program, you can trim them down 
  1981.    and retest.
  1982.  
  1983.  
  1984.    RECORD HANDLING
  1985.  
  1986.    If you are wondering where your WndwStat record is being saved, the 
  1987.    following will show you how it is managed.
  1988.  
  1989.  
  1990.  
  1991.  
  1992.    Chapter 7, Data Mangement                                           Page 33
  1993.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  1994.  
  1995.  
  1996.    Displayed Stack - Each window as it is displayed on the CRT has its 
  1997.    corresponding window record saved in WndwStat starting from the bottom of 
  1998.    the array and stacked upward.  The base window, Window0, is permanent and 
  1999.    saved in WndwStat[0].  The first window displayed is saved in WndwStat[1], 
  2000.    the second in WndwStat[2], and so on.  The top window is in WndwStat[LI] 
  2001.    where LI is the top Level Index.
  2002.  
  2003.    Hidden Stack - Hidden windows have their record moved from WndwStat[LI] to 
  2004.    the top of WndwStat starting from the top of the array stacked downward.  
  2005.    As you can imagine, the hidden stack is simply inverted to the displayed 
  2006.    stack.  So, when a window is hidden, it is placed starting at 
  2007.    WndwStat[MaxWndw].  The last hidden window saved is at WndwStat[HLI].  HLI 
  2008.    is the Hidden Level Index.  Conversely, when a window is shown, it is 
  2009.    removed from the hidden stack and replaced in WndwStat[LI].
  2010.  
  2011.    Random Access - Anytime a window is randomly accessed, the record is pulled 
  2012.    out from the middle of the stack.  The stack is then dropped to fill the 
  2013.    gap. 
  2014.  
  2015.    VirtualStat - The records for the virtual screens are kept in dynamic 
  2016.    memory in an array called VirtualStat and are not shuffled like the window 
  2017.    records.  If a window is virtual, the index to the virtual screen is 
  2018.    WndwStat[?].VI.
  2019.  
  2020.    TopWndwStat - The current window stats are always maintained in the global 
  2021.    record TopWndwStat (TWS).  Combined with a WITH statement, the code is 
  2022.    optimized just like simple global variables.  When working with the current 
  2023.    window, always use TopWndwStat (TWS) in lieu of WndwStat or VirtualStat.
  2024.  
  2025.    TopVirtualStat - Just like TWS, a copy of the current virtual screen record 
  2026.    from VirtualStat is maintained in the global record TopVirtualStat (TVS).
  2027.  
  2028.    RelMode Records - RelMode windows only have the record temporarily placed 
  2029.    in TWS and are not saved in the stack.  They are overwritten with any 
  2030.    change of windows.
  2031.  
  2032.    PermMode Records - PermMode windows have a copy of its record placed in TWS 
  2033.    (and TVS if virtual), but the stack is not shuffled and there are no gaps.  
  2034.    All PermMode records must be the first ones in the stack.  The highest 
  2035.    index of permanent windows is maintained in PLI the Permanent Level Index.
  2036.  
  2037.    Saving Records - Again, WNDW handles this automatically, TWS and TVS are 
  2038.    saved in their appropriate WndwStat or VirtualStat.  Remember, when writing 
  2039.    to virtual screens, TWS and TVS are reversed.  It may be helpful to think 
  2040.    of TVS then as the Top View Stat on the CRT.
  2041.  
  2042.    Finding Records - Since the records are shuffled, just how do you find the 
  2043.    record you want?  Given the window name, GetLevelIndex returns the index in 
  2044.    WndwStat for the window record.
  2045.  
  2046.    Page Records - When swapping pages, WNDW swaps the entire WndwStat array, 
  2047.    top window records, indexes, margins, cursor mode and window modes for 
  2048.    each page.
  2049.  
  2050.    Heap - Virtual screens and hidden windows are saved in the heap.  To 
  2051.  
  2052.  
  2053.    Chapter 7, Data Mangement                                           Page 34
  2054.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2055.  
  2056.  
  2057.    figure your heap requirement, please refer to Appendix A in WNDWREF.DOC.  
  2058.    For your own program, you can also use the HeapOK procedure to test for 
  2059.    MaxAvail.  If there is insufficient heap space, then HeapOK will terminate 
  2060.    the program through the GOOF unit.
  2061.  
  2062.    Stack - Stack checking has been turned off in the units.  Less than 2k is 
  2063.    used for any procedure.
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.    Chapter 7, Data Mangement                                           Page 35
  2115.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2116.  
  2117.  
  2118.    8.  U T I L I T Y   U N I T S
  2119.    
  2120.    Two other units are required with the WNDW package - GOOF and WUTIL.  The 
  2121.    GOOF unit handles programming errors while WUTIL has some high speed 
  2122.    screamin' routines to add zing into many of the window operations.  WUTIL 
  2123.    is already compiled into WNDW, but the unit is available for your other 
  2124.    programs as well.
  2125.  
  2126.  
  2127.    GOOF UNIT
  2128.      
  2129.    All programmers make mistakes, right?  So, what happens when you try to 
  2130.    make more windows than there are records available?  Since WNDW is so 
  2131.    powerful and can even write in RAM, there is a good possibility that your 
  2132.    mistake may not even show up on the screen.  How do you know if anything 
  2133.    has gone wrong?  The GOOF unit was made especially for handling errors.
  2134.  
  2135.    Displaying Errors - When an error is found in your program, the ShowGoof 
  2136.    procedure is called and the program is terminated.  The CRT will display an 
  2137.    error message in a flashing window.  There are eight fatal errors that are 
  2138.    listed in APPENDIX B in WNDWREF.DOC to identify problems before they 
  2139.    happen.  Please refer to it for the error messages and their solutions.
  2140.  
  2141.    Flexibility - ShowGoof is accessed as a circularly referenced unit in the 
  2142.    implementation of the WNDW unit.  This 
  2143.    means that you can freely edit the GOOF unit without needing to recompile 
  2144.    WNDW.  You can even edit it for use in your own applications.  The error 
  2145.    message numbers 1-50 are reserved.  So, for your own applications, it is 
  2146.    suggested that you start with number 51.  If you have thoroughly tested 
  2147.    your program, setting the debug compiler directive to $D- will eliminate 
  2148.    the messages for you released copy.
  2149.  
  2150.  
  2151.    WUTIL UNIT
  2152.  
  2153.    To help make WNDW into a fast unit, some maximum/minimum functions and move 
  2154.    procedures were included in the separate unit WUTIL.  Since WUTIL is an 
  2155.    independent unit, you can also use it by itself in your own programs.
  2156.  
  2157.  
  2158.    Maximum/Minimum - These high speed functions compare two values and return 
  2159.    the result whether maximum or minimum.  As inline directives, they are very 
  2160.    fast.
  2161.  
  2162.      MaxB - returns the maximum of two bytes.
  2163.      MaxI - returns the maximum of two integers.
  2164.      MaxL - returns the maximum of two long integers.
  2165.      MaxW - returns the maximum of two words.
  2166.      MinB - returns the minimum of two bytes.
  2167.      MinI - returns the minimum of two integers.
  2168.      MinL - returns the minimum of two long integers.
  2169.      MinW - returns the minimum of two words.
  2170.  
  2171.    Limit/InRange - These functions compare three values.  Limit returns a 
  2172.    value between Upper and Lower inclusive.  The value can be no higher than 
  2173.  
  2174.  
  2175.    Chapter 8, Utility Units                                            Page 36
  2176.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2177.  
  2178.  
  2179.    Upper and no lower than Lower.  InRange returns true if the value is 
  2180.    between Upper and Lower inclusive.  These routines are written in assembler 
  2181.    for greater speed.
  2182.  
  2183.      LimitB    - returns a byte    value limited Upper/Lower.
  2184.      LimitI    - returns a integer value limited Upper/Lower.
  2185.      LimitL    - returns a longint value limited Upper/Lower.
  2186.      LimitW    - returns a word    value limited Upper/Lower.
  2187.      InRangeB  - returns true if byte    value between Lower/Upper inclusive.
  2188.      InRangeI  - returns true if integer value between Lower/Upper inclusive.
  2189.      InRangeL  - returns true if longint value between Lower/Upper inclusive.
  2190.      InRangeW  - returns true if word    value between Lower/Upper inclusive.
  2191.  
  2192.    There are four high-speed memory transfer routines using 16-bit transfers.  
  2193.    Some check for overlap and some do not for greater speed.
  2194.  
  2195.      ShiftB    - Drop-in replacement for Borland's Move that is twice as fast 
  2196.                  using 16-bit transfers.  Checks for overlap.
  2197.      ShiftW    - Like ShiftB but moves words instead of bytes.
  2198.      MoveB     - Fast 16-bit transfers move.  Does not check for overlap.
  2199.      MoveW     - Like MoveB but moves words instead of bytes.
  2200.  
  2201.    There are three high-speed filling routines that use 16-bit transfers for 
  2202.    character, byte or word arrays.
  2203.  
  2204.      FillC     - Fill an array of characters.
  2205.      FillB     - Fill an array of bytes.
  2206.      FillW     - Fill an array of words.
  2207.  
  2208.    There are four high-speed swapping routines to swap the contents between 
  2209.    any two variables or structures.
  2210.  
  2211.      SwapB     - Swaps a single byte.  Best for the heap.
  2212.      SwapW     - Swaps a single word.  Best for the heap.
  2213.      SwapBs    - Swaps a byte array.
  2214.      SwapWs    - Swaps a word array.
  2215.  
  2216.    These scanning functions allow you to find given byte/word by search 
  2217.    forward or backward.  They have been written in assembler for the greatest 
  2218.    speed.
  2219.  
  2220.      FindB     - returns a 1-based result pointing to the position (not 
  2221.                  offset) of the Find searching forward.  The variable aPtr 
  2222.                  points to Byte/Word 1.  A zero result means the Find was not 
  2223.                  found.
  2224.      FindW     - same as FindB except for words.
  2225.      FindRevB  - same as FindB except searching in reverse.
  2226.      FindRevW  - same as FindW except searching in reverse.
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.    Chapter 8, Utility Units                                            Page 37
  2237.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2238.  
  2239.  
  2240.    These spanning functions allow you to determine the length of a repeated 
  2241.    byte/word by search forward or backward.  They have been written in 
  2242.    assembler for the greatest speed.
  2243.  
  2244.      Span      - returns a 0-based result of how many identical Finds can be 
  2245.                  spanned until the first non-match is found.  The result can 
  2246.                  also be used as the offset (not position) from aPtr to the 
  2247.                  non-match.
  2248.      SpanW     - same as SpanB except for words.
  2249.      SpanRevB  - same as SpanB except searching in reverse.
  2250.      SpanRevW  - same as SpanW except searching in reverse.
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.    Chapter 8, Utility Units                                            Page 38
  2298.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2299.  
  2300.  
  2301.    A P P E N D I X   A :   A P P L I C A T I O N   P R O D U C T S
  2302.  
  2303.  
  2304.    SPEEDPACK II
  2305.  
  2306.    SpeedPack II is a commercial product specifically for Borland/Turbo Pascal 
  2307.    7.0.  Here are excerpts from our press release:
  2308.  
  2309.  
  2310.    Product Name:     SpeedPack II version 7.01 (32-bit specific version)
  2311.    Product Type:     Programming Tools
  2312.    Environments:     Turbo / Borland Pascal 7.0 (DOS, DPMI, and Windows)
  2313.    Package Contents: One high-density disk
  2314.    Files on disk:    40 files plus 190 compressed files.  Includes fully disk-
  2315.                      based manuals and Windows 3.1 help files
  2316.    Disk space:       About 1.2Mb total for all environments
  2317.    Price:            $99.00 (call for discounts!)
  2318.    Guarantee:        30-day money back guarantee
  2319.    Availability:     February 15, 1993
  2320.  
  2321.  
  2322.    PRODUCT OVERVIEW:
  2323.    SpeedPack II provides the Borland Pascal programmer with easy tools to 
  2324.    significantly increase the performance of applications by advancing to 32-
  2325.    bit specific platforms in DOS, DPMI, or Windows with minimal effort.  The 
  2326.    package includes 32-bit System units and an extensive string-handling unit.
  2327.  
  2328.  
  2329.    PRODUCT DESCRIPTION:
  2330.    To increase performance, SpeedPack II allows the programmer to dedicate 
  2331.    applications for 16-bit or 32-bit platforms. The System unit in the Run-
  2332.    Time Library (RTL) has been completely rewritten to take advantage of 32-
  2333.    bit CPUs.  A one-step RTL management utility allows the programmer to 
  2334.    choose platforms using only one button while using the Borland IDE. The 
  2335.    programmer simply recompiles his program to incorporate 32-bit performance 
  2336.    without changing the source code in any way. The resulting applications are 
  2337.    100% compatible.  Additional System units have been included to increase 6-
  2338.    byte real floating point performance and precision that surpasses the 
  2339.    Borland units.  Units incorporate Borland's 7.01 maintenance version 
  2340.    changes.  
  2341.    
  2342.    The System units speed up math, reals, strings, number/string conversions, 
  2343.    text file I/O, file access, sets, heap allocation, and memory transfer.  
  2344.    Performance improvement depends on the programmer's software design. 
  2345.    Specific increases for each routine are shown below. On the "average," 
  2346.    applications may improve from 40 to 100% in speed. Utilities have been 
  2347.    included for the programmer to test the difference in performance between 
  2348.    16- and 32-bit platforms.
  2349.  
  2350.    One-step management utilities are provided for both DOS and Windows.
  2351.  
  2352.    SpeedPack II also comes with a high-speed string unit with 130 string 
  2353.    processing routines all written in assembler with 1,400,000 strings/minute 
  2354.    average speed. The unit can be used in either 16-bit or 32-bit platforms.  
  2355.    Identifiers use C-like mnemonics and are well organized. The Windows 
  2356.  
  2357.  
  2358.    Appendix A: Application Products                                    Page 39
  2359.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2360.  
  2361.  
  2362.    version includes a 350-page help file with cut-and-paste examples for each 
  2363.    routine.  Categories include case, classification, comparison, conversion, 
  2364.    find/replace, insert/delete, justification, membership, operations, 
  2365.    parsing, patterns, placement, position, quantity, sort, tabs, and ASCIIZ. 
  2366.    Many routines have match/ignore case alternates. Code usage is only 7.2kb 
  2367.    for all routines.  Complete source code is included.
  2368.  
  2369.  
  2370.                        ** OUR NON-OBJECTIVE INFORMATION **
  2371.  
  2372.    Did you see our ad in the Borland Et Cetera catalog?  It's there.  Missed 
  2373.    it?
  2374.  
  2375.    OK, Borland and Turbo Pascal programmer's, moving up to full 32-bit power 
  2376.    is just a compile away.  We're serious about how easy this is.  Push ONE 
  2377.    button and presto!  32-bit performance.  Borland only added 32-bit power to 
  2378.    their longint operations.  We added it everywhere!
  2379.  
  2380.    We spent almost three years in the development in this project and wanted 
  2381.    to make sure it was magic and effortless.  Absolutely no code changes.  
  2382.    Doesn't matter who's code you've used.  It will work the first time.  NO 
  2383.    DEBUGGING NECESSARY.
  2384.  
  2385.    And check out the string unit.  This one is extensive and WELL organized.  
  2386.    We spent quite a bit of time laying out an excellent naming scheme so all 
  2387.    the routines were easy to remember.  They'll just fall right out of your 
  2388.    memory and you'll be asking yourself "why didn't I think of something as 
  2389.    simple as this?"  And the parameters ... TOTALLY consisent and common with 
  2390.    all the other routines.  You just can't forget them.
  2391.  
  2392.    And while you're new to the string unit, we went overboard with the Windows 
  2393.    help.  The cross-references are right where you want them in a well mapped 
  2394.    out help system so you'll know right where you are.  There are demos for 
  2395.    every routines.  Lots of tips on programming strings are included -- things 
  2396.    you always wanted to know about Pascal vs. ASCIIZ, alignment affects, and 
  2397.    procedures vs. functions.
  2398.  
  2399.    With 130 routines, it covers every possibility you can think of and the 
  2400.    complete 7500 lines of assembly source code is included.
  2401.  
  2402.    How well did we do on the Windows help?  It's so well done we said, "forget 
  2403.    the manuals!"  Everything is disk-based help.  We put every possible 
  2404.    keyword into the SEARCH buttons so that they are better than any index 
  2405.    could possibly be.  And it's always at your fingertips.
  2406.  
  2407.    But remember, there's only one button to switch between our 32-bit units 
  2408.    and Borland's units.  So, how much more can we write about ONE button?
  2409.  
  2410.    Just think!  You can provide your clients with 16-bit and 32-bit versions 
  2411.    of your product.  You'll be on the edge -- state of the art.
  2412.  
  2413.    FREE!  FREE!  FREE!  You gotta give this a try.  You'll never know how much 
  2414.    faster your programs can be until you try.  Call us.  We will send you a 
  2415.    disk.  If any time within 30 days it didn't do the job you thought, send 
  2416.    the disk back and no bill.  Seriously.
  2417.  
  2418.  
  2419.    Appendix A: Application Products                                    Page 40
  2420.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2421.  
  2422.  
  2423.                     ** ACTUAL PERFORMANCE STATISTICS **
  2424.  
  2425.    ---------------------------------------------------------------------------
  2426.    SPEEDPACK II:  System Unit Performance
  2427.  
  2428.    Table 1.  Performance: Decimal / String Conversions
  2429.    Operation                       Increase        Typical
  2430.    ------------------------------- --------------- -------
  2431.    Str (scalar)                     50-205%           125%
  2432.    Str (real)                      170-250%           180%
  2433.    Str (float)                       5- 35%            20%
  2434.    Val (scalar)                      20-40%            20%
  2435.    Val (real)                       90-340%           300%
  2436.    Val (float)                      20- 55%            30%
  2437.  
  2438.    Table 2.  Performance: LongInt Arithmetic
  2439.    Operation                       Increase
  2440.    ------------------------------- --------
  2441.    Div / Mod                             5%
  2442.    *  (Multiply)                         7%
  2443.    Shl / Shr                            11%
  2444.  
  2445.    Table 3.  Performance: Real Math (6-byte reals)
  2446.    Operation                       Increase        Typical
  2447.    ------------------------------- --------------- -------
  2448.    *  (Multiply)                     -5- 70%           25%
  2449.    /  (Divide)                      170-480%          250%
  2450.    Sqr                               90-150%           95%
  2451.    +  (Add)                          -5- 70%           25%
  2452.    -  (Subtract)                     11-160%           50%
  2453.    Real Compare                       5- 10%            5%
  2454.    LongInt to Real                    5- 35%           15%
  2455.    SqRt                            480-2600%          600%
  2456.    Trunc / Round                     40-140%           80%
  2457.    Frac                              60-430%          170%
  2458.    Int                               20-135%           50%
  2459.    Ln                                60- 95%           80%
  2460.    Exp                              110-130%          125%
  2461.    Sin                               45- 55%           50%
  2462.    Cos                               50- 55%           53%
  2463.    ArcTan                            65- 95%           80%
  2464.  
  2465.    Table 4.  Performance: String Handling
  2466.    Operation                       Increase        Comments
  2467.    ------------------------------- --------------- ----------------------
  2468.    Loading, storing, moving        up to   110%    (such as ":=" )
  2469.    Comparing                       up to    75%    (such as Str1<Str2)
  2470.    Concat                          up to   105%    proportional to length
  2471.    Convert char to string                   20%
  2472.    Copy                            up to    75%    proportional to length
  2473.    Delete                          up to   600%    proportional to length
  2474.    Insert                          up to   500%    proportional to length
  2475.    Pos                             up to   340%    proportional to length
  2476.  
  2477.    Table 5.  Performance: Set Handling
  2478.  
  2479.  
  2480.    Appendix A: Application Products                                    Page 41
  2481.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2482.  
  2483.  
  2484.    Operation                       Increase        Typical
  2485.    ------------------------------- --------------- -------
  2486.    Add component                   40- 80%             60%
  2487.    Add variable range              35-480%
  2488.    Difference                      25-110%             50%
  2489.    Equality                        35-105%             50%
  2490.    Intersection                    25-140%             50%
  2491.    Subset/Superset relation        35-100%             50%
  2492.    Union                           25-120%             50%
  2493.  
  2494.    Table 6.  Performance: Random Numbers
  2495.    Operation                       Increase
  2496.    ------------------------------- --------
  2497.    Integer                           20-40%
  2498.    Real                              25-45%
  2499.    Float ($N+)                       30-50%
  2500.  
  2501.    Table 7.  Performance: Variable / Memory Handling
  2502.    Operation                               Increase
  2503.    --------------------------------------- -----------
  2504.    :=                                      up to  200%
  2505.    Functions returning arrays/records      up to  200%
  2506.    Move                                    up to  200%
  2507.    Copying objects                         up to  195%
  2508.    FillChar                                up to  295%
  2509.    MemAvail                                      5-15%
  2510.    MaxAvail                                     1000+%     (DOS)
  2511.    GetMem / New / Constructor                   15-50%     (DOS)
  2512.    FreeMem / Dispose / Destructor               30-80%     (DOS)
  2513.  
  2514.    Table 8.  Performance: File Access
  2515.    Operation                               Increase
  2516.    --------------------------------------- ----------
  2517.    Assign (text files)                          4-25%
  2518.    Assign (non-text)                           10-30%
  2519.    FilePos (record size >1)                      240%
  2520.    FileSize        (record size >1)               15%
  2521.    Read/ReadLn     (text files)            up to  30%
  2522.    Write/WriteLn   (text files)            up to  25%
  2523.  
  2524.  
  2525.    The increases listed above are compared with Borland's Turbo Pascal or 
  2526.    Borland Pascal 7.0 using Eagle's 32-bit Enhanced System unit.  Gains are 
  2527.    highly dependent on software design, value variations, data alignment, CPU 
  2528.    level and CPU / Disk caching combinations.  Turbo Pascal is a trademark of 
  2529.    Borland International.
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.    Appendix A: Application Products                                    Page 42
  2542.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2543.  
  2544.  
  2545.    SPEEDPACK II:  String Unit Routines
  2546.  
  2547.  
  2548.    Table 1.  Routines: Strg Unit
  2549.    Group           Description                             Routines
  2550.    --------------- --------------------------------------- -------------------
  2551.    Classification  Classifies characters similar to C.     IsAlNum, IsAlpha,
  2552.                    Special routines also classify valid    IsASCII, IsCntrl,
  2553.                    DOS, path, and file name characters.    IsDigit, IsDos,
  2554.                                                            IsFile,  IsGraph,
  2555.                                                            IsLower, IsPath,
  2556.                                                            IsPrint, IsPunct,
  2557.                                                            IsReal,  IsSigned,
  2558.                                                            IsSpace, IsUpper,
  2559.                                                            IsXDigit
  2560.  
  2561.    Comparison      Compares two substrings at a given      StrCmp, StrCmpI
  2562.                    index combined with match/ignore case.
  2563.  
  2564.    Conversion      Converts Pascal strings to or from      StrBin,  StrHex,
  2565.                    binary/hex numbers, ASCII text, ASCIIZ, ValBin,  ValHex,
  2566.                    and embedded tabs.  In-situ routines    AscStr,  StrAsc,
  2567.                    allows Pascal and ASCIIZ to be used     ChrAppZ, ChrLenZ,
  2568.                    interchangeably.                        LnStr,   StrLn,
  2569.                                                            StrReTab,StrDeTab
  2570.  
  2571.    Find / Replace  Finds a given character or substring    ChrRepl, ChrReplI,
  2572.                    and replaces it with another one,       StrRepl, StrReplI
  2573.                    combined with match/ignore case and
  2574.                    overflow recovery.
  2575.  
  2576.    Insert / Delete Includes leading, trailing, padding,    ChrDel,  ChrDelL,
  2577.                    centering, and truncation routines.     ChrDelR, ChrIns,
  2578.                                                            ChrInsL, ChrInsR,
  2579.                                                            ChrPadC, ChrPadL,
  2580.                                                            ChrPadR, StrCut,
  2581.                                                            StrIns
  2582.  
  2583.    Justification   Pads strings for left-, right-, or      StrJL, StrJR, StrJC
  2584.                    center-justification.
  2585.  
  2586.    Membership      Searches for membership or              ChrSpnL, ChrSpnLI,
  2587.                    non-membership.  Reduces a string to    ChrSpnR, ChrSpnRI,
  2588.                    its members.                            StrBrk,  StrSpn,
  2589.                                                            StrMemb
  2590.  
  2591.    Operations      Operates directly on the existing       StrCap,  StrLwr,
  2592.                    characters in the string for case,      StrUpr,  StrRev,
  2593.                    reverse, roll, and sort.                StrRoll, StrSort,
  2594.                                                            LoCase,  UpCase
  2595.  
  2596.    Parsing         Counts, finds, and parses words         WrdQty,   WrdPosL,
  2597.                    separated by spaces or a custom group   WrdPosR,  WrdPosLX,
  2598.                    of delimiters.                          WrdPosRX, WrdL, WrdR,
  2599.                                                            WrdLX,    WrdRX,
  2600.  
  2601.  
  2602.    Appendix A: Application Products                                    Page 43
  2603.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2604.  
  2605.  
  2606.                                                            WrdParse, WrdToken
  2607.  
  2608.    Pattern         Creates strings with repetitive         ChrFill, StrFill,
  2609.                    patterns of concatenation or            StrEnum
  2610.                    enumeration.
  2611.  
  2612.    Placement       Copies, moves, and concatenates         ChrCat,  ChrCatZ,
  2613.                    quickly.  Includes overwrite routines   ChrOvr,  StrCat,
  2614.                    with left-, right- and center-          StrCatV, StrCatX,
  2615.                    justification.                          StrCpy,  StrEnd,
  2616.                                                            StrMov,  StrOvrC,
  2617.                                                            StrOvrL, StrOvrR,
  2618.                                                            StrPeek, StrPoke
  2619.  
  2620.    Position        Locates the position of multiple        ChrPosL,  ChrPosLI,
  2621.                    occurrences of a substring searching    ChrPosR,  ChrPosRI,
  2622.                    from left or right, or from an index,   ChrPosRX, ChrPosRXI,
  2623.                    combined with match/ignore case.        ChrPosX,  ChrPosXI,
  2624.                                                            StrPosL,  StrPosLI,
  2625.                                                            StrPosR,  StrPosRI,
  2626.                                                            StrPosX,  StrPosXI
  2627.  
  2628.    Quantity        Counts the occurrences of a single      ChrQty, ChrQtyI,
  2629.                    character or substring combined with    StrQty, StrQtyI
  2630.                    match/ignore case.
  2631.  
  2632.    Standard        Substitutes faster standard routines    Copy, Delete, Pos
  2633.                    if the Sys unit is not used.
  2634.  
  2635.    Str Functions   Provides function forms of the          StrC, StrCF, StrCFD,
  2636.                    standard Str procedure for all numbers  StrD, StrDF, StrDFD,
  2637.                    including scalars, Turbo reals and      StrE, StrEF, StrEFD,
  2638.                    IEEE reals.                             StrL, StrLF, StrR,
  2639.                                                            StrRF, StrRFD, StrS,
  2640.                                                            StrSF, StrSFD
  2641.  
  2642.     * 7500 lines of assembly source code included.
  2643.     * Alternative routines offer different strategies for faster processing.
  2644.     * Fully optimized object files permit smart linking.
  2645.     * Compiles in DOS, DPMI, and Windows (protected modes).
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.    Appendix A: Application Products                                    Page 44
  2664.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2665.  
  2666.  
  2667.    ACTUAL PERFORMANCE TESTS FOR THE FOLLOWING CONDITIONS ON A 486/25MHZ MACHINE:
  2668.    (386 tests will be faster)
  2669.  
  2670.    ============================================================================
  2671.               BP7 PERFORMANCE GAIN OF SPEEDPACK II IN DOS (w/o IEEE)
  2672.    ============================================================================
  2673.    Please note that these gains are ARBITRARY. They do not reflect the full 
  2674.    range or even an average gain of what can be expected in your own programs.  
  2675.    Gains are highly dependent on software design, the values used, as well as 
  2676.    the CPU level and CPU caching combination used.  For example, file management 
  2677.    routines will reveal greater gains when SmartDrive is not used, because this 
  2678.    program does not put it to task.
  2679.  
  2680.    The value of 0% means 0 gain while 100% means twice as fast.
  2681.  
  2682.                                                     --- TIME (ms) ---
  2683.    TEST DESCRIPTION                                  Borland    Eagle    GAIN
  2684.    ---- ------------------------------------------- -------- -------- -------
  2685.      1: Str for LongInt                                0.124    0.085     45%
  2686.      2: Str for 6-byte/IEEE reals with no exponent     0.280    0.115    144%
  2687.      3: Str for 6-byte/IEEE reals with exponent        0.298    0.105    184%
  2688.      4: Val for LongInt                                0.090    0.070     29%
  2689.      5: Val for 6-byte/IEEE reals with no exponent     0.520    0.108    381%
  2690.      6: Val for 6-byte/IEEE reals with exponent        0.494    0.130    280%
  2691.      7: Div/Mod for LongInt                            0.039    0.038      4%
  2692.      8: *       for LongInt                            0.027    0.025      7%
  2693.      9: Sqr     for LongInt                            0.041    0.041      0%
  2694.     10: Shl/Shr for LongInt                            0.839    0.755     11%
  2695.     11: /   for 6-byte reals only                      0.268    0.094    186%
  2696.     12: *   for 6-byte reals only                      0.074    0.056     31%
  2697.     13: Sqr for 6-byte reals only                      0.047    0.024     93%
  2698.     14: +   for 6-byte reals only                      0.042    0.030     39%
  2699.     15: -   for 6-byte reals only                      0.067    0.043     57%
  2700.     16: Typecast LongInt into 6-byte reals only        0.816    0.693     18%
  2701.     17: Trunc/Round only 6-byte reals to LongInt       0.023    0.013     80%
  2702.     18: Frac   for 6-byte reals only                   0.062    0.022    185%
  2703.     19: Int    for 6-byte reals only                   0.019    0.014     35%
  2704.     20: SqRt   for 6-byte reals only                   1.293    0.203    538%
  2705.     21: Ln     for 6-byte reals only                   1.147    0.623     84%
  2706.     22: Exp    for 6-byte reals only                   2.458    1.192    106%
  2707.     23: Sin    for 6-byte reals only                   0.898    0.582     54%
  2708.     24: Cos    for 6-byte reals only                   0.949    0.589     61%
  2709.     25: ArcTan for 6-byte reals only                   2.137    1.183     81%
  2710.     26: ":="   for strings                             0.043    0.022     96%
  2711.     27: String comparison                              0.080    0.046     75%
  2712.     28: "+"    for strings                             0.085    0.040    113%
  2713.     29: Convert char to string                         0.120    0.091     31%
  2714.     30: Copy   for strings                             0.060    0.037     64%
  2715.     31: Insert for strings                             0.127    0.018    591%
  2716.     32: Delete for strings                             0.118    0.014    729%
  2717.     33: Pos    for strings                             0.097    0.096      2%
  2718.     34: +      for sets (single component)             1.496    0.888     68%
  2719.     35: [a..b] for sets (variable range)               0.246    0.052    373%
  2720.     36: -      for sets                                1.555    0.887     75%
  2721.     37: *      for sets                                1.492    0.857     74%
  2722.  
  2723.  
  2724.    Appendix A: Application Products                                    Page 45
  2725.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2726.  
  2727.  
  2728.     38: +      for sets                                1.488    0.862     73%
  2729.     39: =      for sets                                0.387    0.272     42%
  2730.     40: <=     for sets                                0.808    0.399    103%
  2731.     41: In     for sets                                0.126    0.123      2%
  2732.     42: :=     for sets                                0.644    0.520     24%
  2733.     43: Random integers                                0.893    0.637     40%
  2734.     44: Random 6-byte/IEEE reals                       0.247    0.198     25%
  2735.     45: ":=" array assignment                          9.474    3.178    198%
  2736.     46: Move array                                     9.474    3.181    198%
  2737.     47: Fill array                                    10.584    2.653    299%
  2738.     48: MaxAvail                                       0.852    0.009   9145%
  2739.     49: MemAvail                                       0.943    0.815     16%
  2740.     50: GetMem, New, Constructor  (random)             1.270    1.122     13%
  2741.     51: GetMem, New, Constructor  (sequential)         2.341    1.907     23%
  2742.     52: FreeMem, Dispose, Destructor (random)          5.344    4.368     22%
  2743.     53: FreeMem, Dispose, Destructor (sequential)      3.307    2.596     27%
  2744.     54: Assign        (text files)                     1.760    0.525    235%
  2745.     55: Assign        (non-text files)                 1.728    1.049     65%
  2746.     56: FilePos       (record size >1)                 9.294    3.166    194%
  2747.     57: FileSize      (record size >1)                 9.066    8.559      6%
  2748.     58: Write/WriteLn (text files)                    66.454   51.563     29%
  2749.     59: Read/ReadLn   (text files)                    22.087   17.694     25%
  2750.    ---- ------------------------------------------- -------- -------- -------
  2751.     60: Total gain for this program:                 177.141  115.279     54%
  2752.         Unweighted average gain (59 tests)                               269%
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.    Appendix A: Application Products                                    Page 46
  2786.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2787.  
  2788.  
  2789.    Eagle Performance Software has developed identical products for both Turbo 
  2790.    C and Turbo Pascal.  Our pledge is to provide you quality products with 
  2791.    unparalleled performance and ease of use.  All registered users receive the 
  2792.    complete source code when a signed license agreement is returned.
  2793.  
  2794.  
  2795.    QWIK
  2796.  
  2797.    QWIK - For direct screen video, QWIK is the highest performance screen 
  2798.    writing tools available today for all text modes in any video 
  2799.    configuration.  QWIK provides capabilities far beyond those in the 
  2800.    unit/library that comes with your compiler.   Here are some of the 
  2801.    features:
  2802.                 
  2803.      - Writes on all IBM compatible computers, displays and adapters 
  2804.        including MDA, CGA, EGA, MCGA, VGA, 8514/A, Hercules and 3270 PC.
  2805.      - Works in DOS and DPMI.
  2806.      - Superior video detection routine.
  2807.      - Eliminates snow and flicker.
  2808.      - Writes directly to the screen in absolute rather than relative 
  2809.        coordinates.
  2810.      - Writes in all text modes and column modes.
  2811.      - Writes on all video pages.
  2812.      - Writes on virtual screens in RAM.
  2813.      - Writes text and attribute, text only, or attribute only.
  2814.      - Reads strings, characters and attributes.
  2815.      - Uses End-Of-String (EOS) marker for quick string chaining.
  2816.      - Provides standardized cursor shapes for all adapters.
  2817.      - Enhanced cursor movement.
  2818.      - Compatible with DESQview and similar multitasking environments.
  2819.      - Over 650% faster than standard direct screen writing.
  2820.      - Only 2.9k bytes of code if all 43 utilities are used.
  2821.      - Optimized by the compiler and drops unused code.
  2822.      - Used in all other Eagle products.
  2823.      - Excellent documentation like this document.
  2824.  
  2825.    Here are the product versions:
  2826.  
  2827.       File name    CIS Name    Compiler  Release date
  2828.       -----------  ----------  --------  ------------
  2829.       QWIK71.ZIP   QWIK71.ZIP  BP7        05-27-93
  2830.       QWIKC21.ARC  QWKC21.ARC  TC2        07-06-89
  2831.  
  2832.  
  2833.    WNDW - Here are the current product versions of WNDW:
  2834.  
  2835.       File name    CIS Name    Compiler  Release date
  2836.       -----------  ----------  --------  ------------
  2837.       WNDW70A.ZIP  WNDW70.ZIP  BP7        06-10-93
  2838.       WNDWC21.ARC  WNDC21.ARC  TC2        08-01-89
  2839.  
  2840.  
  2841.    PULL
  2842.  
  2843.    PULL - For multi-level pull-down menus, PULL is fully featured and fully 
  2844.  
  2845.  
  2846.    Appendix A: Application Products                                    Page 47
  2847.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2848.  
  2849.  
  2850.    configurable.  Includes execute, single, and multiple choice menus, 
  2851.    unlimited nested submenus, data entry windows, help windows, directory 
  2852.    windows, message system, and fully completed interfaces.  Some of the 
  2853.    features are:
  2854.  
  2855.      - Uses QWIK and WNDW.
  2856.      - Work window(s) and complete interface for menus
  2857.      - Pull-down menus with 3 menu modes and 8 line modes
  2858.      - Pull-down file directory
  2859.      - Highlighted command letters
  2860.      - Unlimited levels of submenus
  2861.      - Unlimited data entry windows for 9 types of data
  2862.      - Data entry for the work window(s)
  2863.         Free field entry with either fixed column or flexible column 
  2864.          length.
  2865.         Full editing capability including insert cursor mode
  2866.         Full field selection with cursor keys
  2867.         Automatic NumLock for numerical data entry
  2868.         Right or left justification for data entry output
  2869.         Error messages for invalid data entries
  2870.         Error messages for data entries out of range
  2871.      - Automatic sizes and locations for menus.
  2872.      - Operation by cursor 
  2873.        keys or command keys
  2874.      - Pull/Pop between work window and nested submenu(s)
  2875.      - Programmable control of pull and pop sequences
  2876.      - Context-sensitive help
  2877.      - Message lines for prompts and processing
  2878.      - Full working shell for user development
  2879.      - Excellent documentation like this document.
  2880.  
  2881.    Here are the product versions:
  2882.  
  2883.       File name    CIS Name    Compiler  Release date
  2884.       -----------  ----------  --------  ------------
  2885.       PULL70.ZIP   PULL70.ZIP  BP7       06-21-93
  2886.       PULLC21.ARC  PULC21.ARC  TC2       08-01-89
  2887.  
  2888.  
  2889.    ON-LINE SERVICES
  2890.  
  2891.    CompuServe - All updated files and later versions can be found on the 
  2892.    CompuServe Borland Forums (GO BPASCAL for TP and GO BCPPDOS for TC).
  2893.  
  2894.    The Eagle BBS - You can also get the latest files on our 24-hour BBS at 
  2895.    (214)539-9878, 1200/2400/9600/14400 N81 MNP5 V.42.
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.    Appendix A: Application Products                                    Page 48
  2908.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2909.  
  2910.  
  2911.    A P P E N D I X   B :   R E V I S I O N   H I S T O R Y
  2912.  
  2913.    REVISIONS:
  2914.  
  2915.    Version 4.0 (12-12-87):
  2916.      . Incorporated QWIK40.TPU for full IBM compatibility.
  2917.      . Combined all modes into one variable - WindowModes.
  2918.      . Added the following procedures/functions:
  2919.          SetWindowModes
  2920.          RestoreTurboWindow
  2921.          PartitionWindow
  2922.          PartitionCross
  2923.          ClearTitle
  2924.          ClearWindow
  2925.          HideWindow
  2926.          ShowWindow
  2927.          MoveWindow
  2928.          AccessWindow
  2929.          GetLevelIndex
  2930.      . Added 7 background constants.
  2931.      . MakeWindow now requires a WindowName.
  2932.      . TitleWindow requires one more direction parameter.
  2933.      . Current WndwStats are kept in TopWndwStat rather than 
  2934.          WndwStat[LI].
  2935.      . LIcurrent was deleted.
  2936.      . Changed BrdrRec type for easier modifications.
  2937.      . Added 3 more borders - VdoubleBrdr, ThinSolidBrdr2, UserBrdr2.
  2938.      . Changed the following names:
  2939.          MixedBrdr     to HdoubleBrdr
  2940.          ThinSolidBrdr to ThinSolidBrdr1
  2941.          Tattr         to TextAttr     { Assigned by Borland }
  2942.  
  2943.    Version 4.0a (12-12-87):
  2944.      . Set the correct dates for WNDWVARS.TPU and WNDW40.TPU.
  2945.    
  2946.    Version 4.2 (10-22-88):
  2947.      . Major revision over WNDW40; over 50 procedures added or changed.
  2948.      . Added professional documents WNDW42.DOC and WNDWREF.DOC.
  2949.      . Added virtual window power.
  2950.      . Enabled direct writing to hidden windows and virtual screens.
  2951.      . Added multiple video page routines.
  2952.      . Added 28 window relative routines.
  2953.      . Replaced Qbox with MakeWindow RelMode.
  2954.      . Replaced ScrollWindow with WScrollUp, WScrollDown, WInsLine, WDelLine, 
  2955.          and WEosLn.
  2956.      . Changed WSwhereR and WSwhereC to be window relative.
  2957.      . Added window-relative stats in WndwStat.
  2958.      . Changed BrdrRec acronyms.
  2959.      . Changed and added window modes.
  2960.      . Added full line drawing procedures.
  2961.      . Changed WndwVars unit to an include file.
  2962.      . Changed ClearWindow to WClrScr
  2963.      . Changed ClearTitle to WClrTitle
  2964.      . Deleted Attr function.
  2965.  
  2966.  
  2967.  
  2968.    Appendix B: Revision History                                        Page 49
  2969.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  2970.  
  2971.  
  2972.    Version 5.X (12-20-88):
  2973.      . Compiled WNDW42 under TP5.  No other changes.
  2974.  
  2975.    Version 5.Xa (01-11-89):
  2976.      . Provided initialization code for systems with improperly set cursor 
  2977.        modes.
  2978.  
  2979.    Version 5.Xb (03-04-89):
  2980.      . Integrated QWIK5XA.TPU for multi-tasking detection. 
  2981.      . Added feature for self-centering windows.
  2982.      . Fixed RelMode window placement in virtual screens.
  2983.  
  2984.    Version 5.Xc (05-29-89):
  2985.      . Fixed PermMode Virtual window updates.
  2986.      . Virtual cursor now updates in any write-to mode.
  2987.      . Added CrtWI index for the active window on the CRT.
  2988.  
  2989.    Version 5.5 (08-24-89):
  2990.      . Compiled WNDW5XC under TP 5.5.
  2991.      . Corrected WGotoRC in CrtMode for virtual windows.
  2992.  
  2993.    Version 7.0 (05-28-93):
  2994.      . Revised for Borland Pascal 7.0 in DOS and DPMI modes.
  2995.      . Added 27 new WUTIL routines and revised procedure names:
  2996.          MoveWords to MoveW
  2997.          Move16    to ShiftB
  2998.      . Change WNDW procedure names:
  2999.          WWriteA to WWriteSub
  3000.      . Added transparent shadows.
  3001.  
  3002.    Version 7.0a (06-10-93):
  3003.      . Revised ShiftB routine in WUTIL to work properly in reverse moves.
  3004.      . Revised ShadowTrans to be a mode rather than a global variable.
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.    Appendix B: Revision History                                        Page 50
  3030.    WNDW Multi-level Virtual Windows                 User's Guide, Version 7.0a
  3031.  
  3032.  
  3033.    A P P E N D I X   C :   C R E D I T S
  3034.  
  3035.  
  3036.    Fundamental Ideas - The initial concepts of serial-access windows were 
  3037.    developed by Michael Burton in his copy of WINDO.INC, ver 2.4.  The 
  3038.    concepts were used by written permission.
  3039.  
  3040.    Special Effects - Special effects concepts were graciously suggested by 
  3041.    Rick Fothergill.
  3042.  
  3043.    Copyright (c) 1993 by James H. LeMay for Eagle Performance Software.
  3044.    All Rights Reserved.  Protected by the United States Copyright Laws.
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.    Appendix C: Credits                                                 Page 51
  3091.